Fawkes API  Fawkes Development Version
fawkes::LogFileDescriptorToLog Class Reference

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...
 

Detailed Description

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.

Author
Tim Niemueller

Definition at line 38 of file fd_redirect.h.

Constructor & Destructor Documentation

◆ LogFileDescriptorToLog()

fawkes::LogFileDescriptorToLog::LogFileDescriptorToLog ( int  fd,
Logger logger,
const char *  logname,
Logger::LogLevel  log_level 
)

Constructor.

Parameters
fdfile descriptor to redirect to the log
loggerlogger to redirect to
lognamename to use as log component name
log_levellog level to log with

Definition at line 46 of file fd_redirect.cpp.

◆ ~LogFileDescriptorToLog()

fawkes::LogFileDescriptorToLog::~LogFileDescriptorToLog ( )

Destructor.

Definition at line 76 of file fd_redirect.cpp.

References fawkes::Logger::log(), and fawkes::Logger::log_error().


The documentation for this class was generated from the following files: