|
| EthanLogLoop (const std::string &memCgroupMountPoint) |
|
int | addClient (const ContainerId &id, const std::string &tag, unsigned allowedLevels, uint64_t rate=0, uint64_t burstSize=0) |
| Creates a new logging client, which is just pipe with some meta data stored. More...
|
|
void | setClientBasePid (const ContainerId &id, pid_t basePid) |
| Sets the base pid number for the given container. More...
|
|
|
static int | eventFdHandler (sd_event_source *source, int fd, uint32_t revents, void *userData) |
| Handler for wake ups from the event fd. More...
|
|
|
const std::string | mMemCgroupMountPoint |
|
std::thread | mThread |
|
std::mutex | mLock |
|
int | mEventFd |
|
std::deque< Event > | mEvents |
|
std::list< std::unique_ptr< EthanLogClient > > | mClients |
|
◆ addClient()
int EthanLogLoop::addClient |
( |
const ContainerId & |
id, |
|
|
const std::string & |
tag, |
|
|
unsigned |
allowedLevels, |
|
|
uint64_t |
rate = 0 , |
|
|
uint64_t |
burstSize = 0 |
|
) |
| |
Creates a new logging client, which is just pipe with some meta data stored.
- Parameters
-
[in] | id | The container id. |
[in] | tag | The identifier to assign to all log messages. |
[in] | allowedLevels | Bitmask of allowed levels. |
[in] | rate | The rate limit (actually limiting TBD) |
[in] | burstSize | The burst limit (actually limiting TBD) |
- Returns
◆ eventFdHandler()
int EthanLogLoop::eventFdHandler |
( |
sd_event_source * |
source, |
|
|
int |
fd, |
|
|
uint32_t |
revents, |
|
|
void * |
userData |
|
) |
| |
|
staticprivate |
Handler for wake ups from the event fd.
This will either be called if the terminate flag is set or when a new client has been added to the list of clients.
- Parameters
-
[in] | source | The event loop source handler. |
[in] | fd | Should be the event fd. |
[in] | revents | The event that triggered the wake up. |
[in] | userData | Pointer back to the instance of EthanLogLoop class. |
- Returns
◆ eventLoop()
void EthanLogLoop::eventLoop |
( |
| ) |
|
|
private |
Event loop thread function.
Runs the event loop processing inputs from logging pipes until the terminate flag is set.
◆ setClientBasePid()
void EthanLogLoop::setClientBasePid |
( |
const ContainerId & |
id, |
|
|
pid_t |
basePid |
|
) |
| |
Sets the base pid number for the given container.
This is used so we can pass the real pid to journald.
- Parameters
-
[in] | id | The container id. |
[in] | basePid | The pid of the init process inside the container. |
◆ wakeLoop()
void EthanLogLoop::wakeLoop |
( |
| ) |
|
|
private |
Wakes the event loop.
Writes to the eventfd which should wake the event loop thread. This is used when either a new client is added or we wish to terminate the event loop thread.
The documentation for this class was generated from the following files:
- plugins/EthanLog/source/EthanLogLoop.h
- plugins/EthanLog/source/EthanLogLoop.cpp