AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::Logger Class Referenceabstract

Logger is a class for writing information, debug info, warnings but also throwing exceptions in a stream-alike way. More...

#include <Logger.h>

+ Inheritance diagram for agx::Logger:

Public Types

enum  Priority { HIGHEST_PRIORITY = 2147483647, LOWEST_PRIORITY = 10000, DEFAULT_PRIORITY = 1073741824 }
 Specifies the ranges of the priority which can be assigned to a singleton at the time of creation. More...
 

Public Member Functions

 Logger ()
 
 ADD_NOTIFY_FUNCTIONALITY_TO_CLASS ()
 
virtual std::string getClassName () const =0
 
agx::String getLogFilename () const
 
int getPriority () const
 Return the shutdown priority of the singleton instance. More...
 
bool openLogfile (const agx::String &path, bool overwrite, bool closeAndOpen)
 Open a new log file. More...
 
void setLogNotifyLevel (Notify::NotifyLevel l)
 Set the lowest level of messages that will be written to the logger system. More...
 

Static Public Member Functions

static Logger * instance (void)
 Return the singleton object. More...
 

Protected Member Functions

void _shutdown ()
 
void shutdown () override
 Implement this method to cleanup your Singleton class. More...
 

Detailed Description

Logger is a class for writing information, debug info, warnings but also throwing exceptions in a stream-alike way.

Always use the macros LOGGER_*() This class is thread safe. It should ONLY be called from AGX threads. If you create a thread of your own, and call LOGGER it will certainly crash. AGX has a "mainThread", which is the thread from which agx::init() was called. This is also part of the "safe zone".

Definition at line 51 of file Logger.h.

Member Enumeration Documentation

enum agx::Singleton::Priority
inherited

Specifies the ranges of the priority which can be assigned to a singleton at the time of creation.

Enumerator
HIGHEST_PRIORITY 

The highest priority that can be given to a singleton.

LOWEST_PRIORITY 

The lowest priority that can be given to a singleton.

DEFAULT_PRIORITY 

The default priority given to a singleton.

Definition at line 35 of file Singleton.h.

Constructor & Destructor Documentation

agx::Logger::Logger ( )

Member Function Documentation

void agx::Singleton::_shutdown ( )
protectedinherited
agx::Logger::ADD_NOTIFY_FUNCTIONALITY_TO_CLASS ( )
virtual std::string agx::Singleton::getClassName ( ) const
pure virtualinherited
agx::String agx::Logger::getLogFilename ( ) const
Returns
the path of the file where log messages will be written
int agx::Singleton::getPriority ( ) const
inherited

Return the shutdown priority of the singleton instance.

static Logger* agx::Logger::instance ( void  )
static

Return the singleton object.

bool agx::Logger::openLogfile ( const agx::String &  path,
bool  overwrite,
bool  closeAndOpen 
)

Open a new log file.

Parameters
path- Path to a new log file
overwrite- if false, a version number will be added to the filename: test.log.1, test.log.2 etc.
closeAndOpen- if true, an opened log file will be closed and the new path will be opened. If false, nothing will happen, false will be returned
Returns
true if log file is successfully opened.
void agx::Logger::setLogNotifyLevel ( Notify::NotifyLevel  l)

Set the lowest level of messages that will be written to the logger system.

void agx::Logger::shutdown ( )
overrideprotectedvirtual

Implement this method to cleanup your Singleton class.

Reimplemented from agx::Singleton.


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