Log Class Reference
|
Ratpac-two
|
Public Types | |
| enum | Level { WARN = 0 , INFO = 1 , DETAIL = 2 , DEBUG = 3 } |
Static Public Member Functions | |
| static bool | Init (std::string _filename, Level display=INFO, Level log=DETAIL) |
| static int | GetDisplayLevel () |
| static void | SetDisplayLevel (Level level) |
| static int | GetLogLevel () |
| static void | SetLogLevel (Level level) |
| static void | Die (std::string message, int return_code=1) |
| static void | Assert (bool condition, std::string message, int return_code=1) |
| static const std::string | GetLogBuffer () |
| static void | AddMacro (const std::string &contents) |
| static const std::string & | GetMacro () |
| static void | AddObject (const std::string &name, TObject *obj) |
| static std::vector< std::pair< std::string, TObject * > > | GetObjects () |
| static void | SetDBTraceState (bool state=true) |
| static bool | GetDBTraceState () |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, int value) |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, double value) |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, const std::string &value) |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, const std::vector< int > &value) |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, const std::vector< double > &value) |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, const std::vector< std::string > &value) |
| static void | TraceDBAccess (const std::string &table, const std::string &index, const std::string &field, const json::Value &value) |
| static TMap * | GetDBTraceMap () |
Protected Member Functions | |
| Log () | |
Static Protected Member Functions | |
| static void | AddDBEntry (const std::string &key, const std::string &value) |
| Inline functions. More... | |
| static void | SetupIO () |
| static void | ClearOMText (omtext *out) |
Static Protected Attributes | |
| static omtext * | outstreams [4] = {&warn, &info, &detail, &debug} |
| static std::string | filename |
| static oftext | logfile |
| static int | display_level = Log::DEBUG |
| static int | log_level = Log::DETAIL |
| static std::string | macro |
| static bool | enable_dbtrace = false |
| static TMap * | dbtrace = 0 |
| static std::vector< std::pair< std::string, TObject * > > | objects |
Member Enumeration Documentation
◆ Level
| enum RAT::Log::Level |
Constructor & Destructor Documentation
◆ Log()
|
protected |
This class cannot be instantiated.
Member Function Documentation
◆ AddDBEntry()
|
inlinestaticprotected |
Inline functions.
Add a string key/value pair to the dbtrace map
◆ AddMacro()
|
inlinestatic |
Add macro commands to buffer. Don't forget newlines!
◆ AddObject()
|
inlinestatic |
Log a TObject. Do not delete this pointer after you log it!
◆ Assert()
|
static |
Write message to warn stream and immediately terminate if @condition is not true. return_code is returned to the OS to signal job failure
◆ ClearOMText()
|
staticprotected |
Utility function to remove all output streams from an omtext object.
◆ Die()
|
static |
Write message to warn stream and immediately terminate, sending return_code back to OS.
◆ GetDBTraceState()
|
inlinestatic |
Get current DB tracing state.
◆ GetDisplayLevel()
|
inlinestatic |
Get the current verbosity level for display on screen.
◆ GetLogBuffer()
|
static |
Return reference to string containing entire log from this session
◆ GetLogLevel()
|
inlinestatic |
Get the current verbosity level for writing to log file
◆ GetMacro()
|
inlinestatic |
Get the macro commands that have been run so far
◆ GetObjects()
|
inlinestatic |
Get an array of logged TObjects. Should be used by output processors just before closing their output file.
◆ Init()
Initialize the logging system.
- Parameters
-
_filename Name of log file to open for writing. display Verbosity level for display on screen log Verbosity level for writing to log file.
◆ SetDBTraceState()
|
inlinestatic |
Enable/Disable tracing of RATDB accesses.
AddDBAccess() does nothing if tracing is disabled (default)
◆ SetDisplayLevel()
|
static |
Set verbosity level for display on screen.
◆ SetLogLevel()
|
static |
Set verbosity level for writing to log file.
◆ SetupIO()
|
staticprotected |
Reset output streams to according to verbosity levels.
Call this method after changing display_level or log_level to update where warn, info, detail, debug send messages.
◆ TraceDBAccess() [1/7]
|
inlinestatic |
Add a RATDB JSON object access to the DB trace.
◆ TraceDBAccess() [2/7]
|
inlinestatic |
Add a RATDB string access to the DB trace.
◆ TraceDBAccess() [3/7]
|
inlinestatic |
Add a RATDB double array access to the DB trace.
◆ TraceDBAccess() [4/7]
|
inlinestatic |
Add a RATDB integer array access to the DB trace.
◆ TraceDBAccess() [5/7]
|
inlinestatic |
Add a RATDB string access to the DB trace.
◆ TraceDBAccess() [6/7]
|
inlinestatic |
Add a RATDB double access to the DB trace.
◆ TraceDBAccess() [7/7]
|
inlinestatic |
Add a RATDB integer access to the DB trace.
Member Data Documentation
◆ dbtrace
|
staticprotected |
Record of all accessed RATDB fields
◆ display_level
|
staticprotected |
Current display verbosity
◆ enable_dbtrace
|
staticprotected |
Enable RATDB tracing?
◆ filename
|
staticprotected |
Name of log file.
◆ log_level
|
staticprotected |
Current log file verbsoity
◆ logfile
◆ macro
|
staticprotected |
Buffer of macro commands run so far
◆ objects
|
staticprotected |
Record of logged TObjects
◆ outstreams
|
staticprotected |
Pointers to global output streams in order of verbosity.
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/core/include/RAT/Log.hh
- /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/core/src/Log.cc
Generated by