Class for handling logging of messages.
More...
#include <Notify.h>
|
| 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
} |
| |
| 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...
|
| |
|
| | Notify (std::ostream &out_stream=std::cerr) |
| | Constructor.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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)
|
| |
| std::ostream & | outStream () |
| |
| bool | removeCallback (NotifyCallback *callback) |
| | Remove a callback from list of callbacks to report messages to.
|
| |
| bool | removeStream (std::ostream *stream) |
| | Remove a stream from list of streams to report messages to.
|
| |
| void | setBreakOnError (bool f) |
| | WIN32 specific: If set to true, a breakpoint will be set in debug build.
|
| |
| agx::String | setDebugStrings (NotifyLevel l, const char *function, int line, const char *file) |
| |
| void | setLogNotifyLevel (NotifyLevel l) |
| | Set the notify level for the LogStream.
|
| |
| bool | setNotifyLevel (NotifyCallback *callback, NotifyLevel l) |
| | Set the notify level for a specific callback.
|
| |
| void | setNotifyLevel (NotifyLevel level) |
| | Set the current notify level.
|
| |
| bool | setNotifyLevel (std::ostream *stream, NotifyLevel l) |
| | Set the notify level for a specific stream.
|
| |
| void | setOutputMode (NotifyLevel l) |
| | Set the current output mode, do not use! (used internally)
|
| |
| void | setThrowOnError (bool v) |
| | Specify whether we should Throw an exception upon calling error?
|
| |
| void | setToLogOnly (bool f) |
| | If f==true, logging will occur only to the LogStream, not to any of the associated ostreams.
|
| |
| void | shutdown () override |
| | Implement this method to cleanup your Singleton class.
|
| |
| | 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.
|
| |
Class for handling logging of messages.
Definition at line 63 of file Notify.h.
◆ NotifyLevel
| Enumerator |
|---|
| NOTIFY_DEBUG | DEBUG (lowest) level.
|
| NOTIFY_INFO | INFO level.
|
| NOTIFY_WARNING | WARNING level.
|
| NOTIFY_ERROR | ERROR (highest) level.
|
| NOTIFY_END | |
| NOTIFY_CLEAR | |
| NOTIFY_PUSH | |
| NOTIFY_LOGONLY | |
Definition at line 67 of file Notify.h.
◆ NotifySelection
| Enumerator |
|---|
| PRINT_NONE | |
| PRINT_FILE | |
| PRINT_TAG | |
| PRINT_LINE | |
| PRINT_FUNCTION | |
| PRINT_SELECTION_END | |
| PRINT_DEFAULT | |
| PRINT_ALL | |
Definition at line 77 of file Notify.h.
◆ Notify()
| agx::Notify::Notify |
( |
std::ostream & |
out_stream = std::cerr | ) |
|
Constructor.
- Parameters
-
| out_stream | - Connect the default output to a specified stream, default is std::cerr |
◆ ~Notify()
| virtual agx::Notify::~Notify |
( |
| ) |
|
|
virtual |
◆ addCallback()
Add a callback class that will be printed to if the notify level less or equal to l.
◆ addStream()
| 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.
◆ buildString()
◆ clear()
| void agx::Notify::clear |
( |
| ) |
|
|
protected |
◆ getBreakOnError()
| bool agx::Notify::getBreakOnError |
( |
| ) |
const |
- Returns
- true if an a breakpoint should be set upon calling error
◆ getNotifyLevel()
- Returns
- the current notify level
◆ getOutputMode()
- Returns
- the current notify level
◆ getThrowOnError()
| bool agx::Notify::getThrowOnError |
( |
| ) |
const |
- Returns
- true if an exception should be thrown upon calling error?
◆ getToLogOnly()
| bool agx::Notify::getToLogOnly |
( |
| ) |
const |
- Returns
- true if logging occurs to the LogStream ONLY.
◆ instance()
| static Notify * agx::Notify::instance |
( |
| ) |
|
|
static |
- Returns
- pointer to the singleton instance of a Notify
◆ logStream() [1/2]
- Returns
- a reference to the LogStream used for streaming messages to function callbacks, files..
◆ logStream() [2/2]
- Returns
- a reference to the LogStream used for streaming messages to function callbacks, files..
◆ openLog()
| bool agx::Notify::openLog |
( |
const agx::String & |
filename | ) |
|
◆ outStream()
| std::ostream & agx::Notify::outStream |
( |
| ) |
|
◆ removeCallback()
Remove a callback from list of callbacks to report messages to.
- Returns
- true if the stream was removed
◆ removeStream()
| bool agx::Notify::removeStream |
( |
std::ostream * |
stream | ) |
|
Remove a stream from list of streams to report messages to.
NO memory will be deallocated.
- Returns
- true if the stream was removed
◆ setBreakOnError()
| 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:
- Built in VisualStudio
- Build in DEBUG mode
Observe, if this is set to true, NO exception will be generated if the above conditions are met.
◆ setDebugStrings()
| agx::String agx::Notify::setDebugStrings |
( |
NotifyLevel |
l, |
|
|
const char * |
function, |
|
|
int |
line, |
|
|
const char * |
file |
|
) |
| |
◆ setLogNotifyLevel()
◆ setNotifyLevel() [1/3]
Set the notify level for a specific callback.
- Returns
- true if the stream exists
◆ setNotifyLevel() [2/3]
Set the current notify level.
◆ setNotifyLevel() [3/3]
| bool agx::Notify::setNotifyLevel |
( |
std::ostream * |
stream, |
|
|
NotifyLevel |
l |
|
) |
| |
Set the notify level for a specific stream.
- Returns
- true if the stream exists
◆ setOutputMode()
Set the current output mode, do not use! (used internally)
◆ setThrowOnError()
| void agx::Notify::setThrowOnError |
( |
bool |
v | ) |
|
Specify whether we should Throw an exception upon calling error?
◆ setToLogOnly()
| void agx::Notify::setToLogOnly |
( |
bool |
f | ) |
|
If f==true, logging will occur only to the LogStream, not to any of the associated ostreams.
◆ shutdown()
| void agx::Notify::shutdown |
( |
| ) |
|
|
overridevirtual |
◆ str() [1/2]
| std::string agx::Notify::str |
( |
| ) |
const |
|
protected |
◆ str() [2/2]
| void agx::Notify::str |
( |
const std::string & |
text | ) |
|
|
protected |
◆ m_clear
| Clear agx::Notify::m_clear |
|
protected |
◆ m_end
◆ m_log
| LogOnly agx::Notify::m_log |
|
protected |
◆ m_push
The documentation for this class was generated from the following file: