AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agx::Logger Class Reference

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 Member Functions

 Logger ()
 
 ADD_NOTIFY_FUNCTIONALITY_TO_CLASS ()
 
agx::String getLogFilename () const
 
bool openLogfile (const agx::String &path, bool overwrite, bool closeAndOpen)
 Open a new log file.
 
void setLogNotifyLevel (Notify::NotifyLevel l)
 Set the lowest level of messages that will be written to the logger system.
 
- Public Member Functions inherited from agx::Singleton
 Singleton (int priority=DEFAULT_PRIORITY)
 Default constructor.
 
virtual std::string getClassName () const =0
 
int getPriority () const
 Return the shutdown priority of the singleton instance.
 
virtual void shutdown ()=0
 Implement this method to cleanup your Singleton class.
 

Static Public Member Functions

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

Protected Member Functions

void shutdown () override
 Implement this method to cleanup your Singleton class.
 
- Protected Member Functions inherited from agx::Singleton
virtual ~Singleton ()
 Destructor.
 
void _shutdown ()
 

Additional Inherited Members

- Public Types inherited from agx::Singleton
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...
 

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.

Constructor & Destructor Documentation

◆ Logger()

agx::Logger::Logger ( )

Member Function Documentation

◆ ADD_NOTIFY_FUNCTIONALITY_TO_CLASS()

agx::Logger::ADD_NOTIFY_FUNCTIONALITY_TO_CLASS ( )

◆ getLogFilename()

agx::String agx::Logger::getLogFilename ( ) const
Returns
the path of the file where log messages will be written

◆ instance()

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

Return the singleton object.

◆ openLogfile()

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.

◆ setLogNotifyLevel()

void agx::Logger::setLogNotifyLevel ( Notify::NotifyLevel  l)

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

◆ shutdown()

void agx::Logger::shutdown ( )
overrideprotectedvirtual

Implement this method to cleanup your Singleton class.

Implements agx::Singleton.


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