Fawkes API
Fawkes Development Version
|
Redirect a file descriptor to the log. More...
#include <>>
Public Member Functions | |
LogFileDescriptorToLog (int fd, Logger *logger, const char *logname, Logger::LogLevel log_level) | |
Constructor. More... | |
~LogFileDescriptorToLog () | |
Destructor. More... | |
Redirect a file descriptor to the log.
This re-binds the file descriptor to a pipe, where it listens on the reading end and prints input to the logger. On destruction, it restores the original file descriptor (which is therefore not closed but re-bound.
Definition at line 38 of file fd_redirect.h.
fawkes::LogFileDescriptorToLog::LogFileDescriptorToLog | ( | int | fd, |
Logger * | logger, | ||
const char * | logname, | ||
Logger::LogLevel | log_level | ||
) |
Constructor.
fd | file descriptor to redirect to the log |
logger | logger to redirect to |
logname | name to use as log component name |
log_level | log level to log with |
Definition at line 46 of file fd_redirect.cpp.
fawkes::LogFileDescriptorToLog::~LogFileDescriptorToLog | ( | ) |
Destructor.
Definition at line 76 of file fd_redirect.cpp.
References fawkes::Logger::log(), and fawkes::Logger::log_error().