Cogs.Core
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Cogs::Logging::FileLogger Class Reference
Inheritance diagram for Cogs::Logging::FileLogger:
Cogs::Logging::Consumer

Public Member Functions

void initialize (const char *filename)
 
void cleanUp ()
 
virtual void consumeMessage (const char *source, Category category, uint32_t errorNumber, const char *message, const char *filename, int lineNumber) override
 
- Public Member Functions inherited from Cogs::Logging::Consumer
 Consumer ()
 Constructs a new Consumer instance.
 
virtual ~Consumer ()
 Unregisters this consumer from the LogManager and destroys this instance.
 
virtual void consumeMessage (const char *source, Category category, uint32_t errorNumber, const char *message, const char *filename, int lineNumber)=0
 
Category getMinimumCategory () const
 
void setMinimumCategory (Category category)
 Set the minimum category level of messages that this consumer will output.
 
void enableFilenames (bool enable)
 

Static Public Member Functions

static FileLoggerinstance ()
 Retrieve the global fileLogger instance.
 
- Static Public Member Functions inherited from Cogs::Logging::Consumer
static void setDefaultMinimumCategory (Category category)
 Sets the default minimum category for all future consumers.
 
static const char * getCategoryName (Category category)
 Retrieves a human-friendly name for the given category level.
 
static const char * getCategoryNameColor (Category category)
 

Private Attributes

FILE * outputFile = nullptr
 Handle to the file which will receive log messages.
 

Additional Inherited Members

- Protected Attributes inherited from Cogs::Logging::Consumer
Mutex mutex
 Mutex available for implementations to use if needed.
 
bool outputFilenames = false
 Flag controlling whether or not to include the filenames for message sources.
 

Detailed Description

Definition at line 6 of file FileLogger.h.

Constructor & Destructor Documentation

◆ ~FileLogger()

Cogs::Logging::FileLogger::~FileLogger ( )
override

Definition at line 7 of file FileLogger.cpp.

Member Function Documentation

◆ cleanUp()

void Cogs::Logging::FileLogger::cleanUp ( )

Definition at line 25 of file FileLogger.cpp.

◆ consumeMessage()

void Cogs::Logging::FileLogger::consumeMessage ( const char *  source,
Category  category,
uint32_t  errorNumber,
const char *  message,
const char *  filename,
int  lineNumber 
)
overridevirtual

Implements Cogs::Logging::Consumer.

Definition at line 34 of file FileLogger.cpp.

◆ initialize()

void Cogs::Logging::FileLogger::initialize ( const char *  filename)

Definition at line 17 of file FileLogger.cpp.

◆ instance()

Cogs::Logging::FileLogger & Cogs::Logging::FileLogger::instance ( )
static

Retrieve the global fileLogger instance.

(Or construct your own.)

Definition at line 11 of file FileLogger.cpp.

Member Data Documentation

◆ outputFile

FILE* Cogs::Logging::FileLogger::outputFile = nullptr
private

Handle to the file which will receive log messages.

Definition at line 21 of file FileLogger.h.


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