|
AGX Dynamics
2.37.3.2
|
Class for handling logging of messages. More...
#include <Notify.h>
Inheritance diagram for agx::Notify:Public Types | |
| enum | NotifyLevel { NOTIFY_DEBUG = 1 << 0, NOTIFY_INFO = 1 << 1, NOTIFY_WARNING = 1 << 2, NOTIFY_ERROR = 1 << 3, NOTIFY_END = 1 << 4, NOTIFY_CLEAR = 1 << 5, NOTIFY_PUSH = 1 << 6, NOTIFY_LOGONLY = 1 << 7 } |
| enum | NotifySelection { PRINT_NONE = 0, PRINT_FILE = 1, PRINT_TAG = 2, PRINT_LINE = 4, PRINT_FUNCTION = 8, PRINT_SELECTION_END = 8, PRINT_DEFAULT = PRINT_TAG | PRINT_FUNCTION, PRINT_ALL = PRINT_FILE | PRINT_TAG | PRINT_LINE | PRINT_FUNCTION } |
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... | |
Public Member Functions | |
| Notify (std::ostream &out_stream=std::cerr) | |
| Constructor. More... | |
| virtual | ~Notify () |
| void | addCallback (NotifyCallback *callback, NotifyLevel l) |
| Add a callback class that will be printed to if the notify level less or equal to l. More... | |
| void | addStream (std::ostream *stream, NotifyLevel l) |
| Add a stream that will be printed to if the notify level less or equal to l, the memory will NOT be managed by this class. More... | |
| agx::String | buildString () |
| bool | getBreakOnError () const |
| NotifyLevel | getNotifyLevel () const |
| NotifyLevel | getOutputMode () const |
| bool | getThrowOnError () const |
| bool | getToLogOnly () const |
| agx::LogStream & | logStream () |
| const agx::LogStream & | logStream () const |
| bool | openLog (const agx::String &filename) |
| Open a log file (in the LogStream) More... | |
| std::ostream & | outStream () |
| bool | removeCallback (NotifyCallback *callback) |
| Remove a callback from list of callbacks to report messages to. More... | |
| bool | removeStream (std::ostream *stream) |
| Remove a stream from list of streams to report messages to. More... | |
| void | setBreakOnError (bool f) |
| WIN32 specific: If set to true, a breakpoint will be set in debug build. More... | |
| agx::String | setDebugStrings (NotifyLevel l, const char *function, int line, const char *file) |
| void | setLogNotifyLevel (NotifyLevel l) |
| Set the notify level for the LogStream. More... | |
| void | setNotifyLevel (NotifyLevel level) |
| Set the current notify level. More... | |
| bool | setNotifyLevel (NotifyCallback *callback, NotifyLevel l) |
| Set the notify level for a specific callback. More... | |
| bool | setNotifyLevel (std::ostream *stream, NotifyLevel l) |
| Set the notify level for a specific stream. More... | |
| void | setOutputMode (NotifyLevel l) |
| Set the current output mode, do not use! (used internally) More... | |
| void | setThrowOnError (bool v) |
| Specify whether we should Throw an exception upon calling error? More... | |
| void | setToLogOnly (bool f) |
If f==true, logging will occur only to the LogStream, not to any of the associated ostreams. More... | |
| void | shutdown () override |
| Implement this method to cleanup your Singleton class. More... | |
Public Member Functions inherited from agx::Singleton | |
| Singleton (int priority=DEFAULT_PRIORITY) | |
| Default constructor. More... | |
| virtual std::string | getClassName () const =0 |
| int | getPriority () const |
| Return the shutdown priority of the singleton instance. More... | |
Static Public Member Functions | |
| static Notify * | instance () |
Protected Member Functions | |
| void | clear () |
| std::string | str () const |
| void | str (const std::string &text) |
Protected Member Functions inherited from agx::Singleton | |
| virtual | ~Singleton () |
| Destructor. More... | |
| void | _shutdown () |
Protected Attributes | |
| Clear | m_clear |
| End | m_end |
| LogOnly | m_log |
| Push | m_push |
Friends | |
| void | agx::setNumThreads (size_t numThreads) |
| void | agxCore::init () |
| agx::Notify::Notify | ( | std::ostream & | out_stream = std::cerr | ) |
Constructor.
| out_stream | - Connect the default output to a specified stream, default is std::cerr |
|
virtual |
| void agx::Notify::addCallback | ( | NotifyCallback * | callback, |
| NotifyLevel | l | ||
| ) |
Add a callback class that will be printed to if the notify level less or equal to l.
| void agx::Notify::addStream | ( | std::ostream * | stream, |
| NotifyLevel | l | ||
| ) |
Add a stream that will be printed to if the notify level less or equal to l, the memory will NOT be managed by this class.
| agx::String agx::Notify::buildString | ( | ) |
|
protected |
| bool agx::Notify::getBreakOnError | ( | ) | const |
| NotifyLevel agx::Notify::getNotifyLevel | ( | ) | const |
| NotifyLevel agx::Notify::getOutputMode | ( | ) | const |
| bool agx::Notify::getThrowOnError | ( | ) | const |
| bool agx::Notify::getToLogOnly | ( | ) | const |
|
static |
| agx::LogStream& agx::Notify::logStream | ( | ) |
| const agx::LogStream& agx::Notify::logStream | ( | ) | const |
| bool agx::Notify::openLog | ( | const agx::String & | filename | ) |
Open a log file (in the LogStream)
| std::ostream& agx::Notify::outStream | ( | ) |
| bool agx::Notify::removeCallback | ( | NotifyCallback * | callback | ) |
Remove a callback from list of callbacks to report messages to.
| bool agx::Notify::removeStream | ( | std::ostream * | stream | ) |
Remove a stream from list of streams to report messages to.
NO memory will be deallocated.
| void agx::Notify::setBreakOnError | ( | bool | f | ) |
WIN32 specific: If set to true, a breakpoint will be set in debug build.
This makes it easier to debug problems in VisualStudio. A call to this method has effect only if:
Observe, if this is set to true, NO exception will be generated if the above conditions are met.
| agx::String agx::Notify::setDebugStrings | ( | NotifyLevel | l, |
| const char * | function, | ||
| int | line, | ||
| const char * | file | ||
| ) |
| void agx::Notify::setLogNotifyLevel | ( | NotifyLevel | l | ) |
Set the notify level for the LogStream.
| void agx::Notify::setNotifyLevel | ( | NotifyLevel | level | ) |
Set the current notify level.
| bool agx::Notify::setNotifyLevel | ( | NotifyCallback * | callback, |
| NotifyLevel | l | ||
| ) |
Set the notify level for a specific callback.
| bool agx::Notify::setNotifyLevel | ( | std::ostream * | stream, |
| NotifyLevel | l | ||
| ) |
Set the notify level for a specific stream.
| void agx::Notify::setOutputMode | ( | NotifyLevel | l | ) |
Set the current output mode, do not use! (used internally)
| void agx::Notify::setThrowOnError | ( | bool | v | ) |
Specify whether we should Throw an exception upon calling error?
| void agx::Notify::setToLogOnly | ( | bool | f | ) |
If f==true, logging will occur only to the LogStream, not to any of the associated ostreams.
|
overridevirtual |
Implement this method to cleanup your Singleton class.
Reimplemented from agx::Singleton.
|
protected |
|
protected |
|
friend |
|
friend |