NAGASH 0.9.8
Next Generation Analysis System
|
Maniplulate all messages of NAGASH. More...
#include "NAGASH/MSGTool.h"
Classes | |
class | MSGTitleGuard |
Used to call MSGTool::EndTitle() automatically. More... | |
Public Member Functions | |
MSGTool ()=default | |
MSGTool (const MSGTool &msg)=delete | |
MSGTool (const MSGTool &msg, int ThreadNumber) | |
Construct sub-MSGTool for multi-thread usage. | |
MSGTool (MSGLevel level, const TString &name="UNKNOWN") | |
Construct MSGTool with given level, message below this level will not be printed. | |
MSGTool (MSGTool &&msg)=delete | |
~MSGTool () | |
void | CloseLog () |
Close the log file. | |
void | CreateLog (const TString &name) |
Create log file with given file name. | |
void | EndFocusRegion (const TString &name) |
End focus region. | |
void | EndTitle () |
End the current title. | |
MSGLevel | Level () const |
Get the current message level. | |
template<typename... Args> | |
void | MSG (MSGLevel level, Args &&...args) |
Output with given message level. Messages below the level in MSGTool will be ignored. | |
template<typename... Args> | |
void | MSG_DEBUG (Args &&...args) |
Output with DEBUG level. Messages below the level in MSGTool will be ignored. | |
template<typename... Args> | |
void | MSG_ERROR (Args &&...args) |
Output with ERROR level. Messages below the level in MSGTool will be ignored. | |
template<typename... Args> | |
void | MSG_INFO (Args &&...args) |
Output with INFO level. Messages below the level in MSGTool will be ignored. | |
template<typename... Args> | |
void | MSG_WARNING (Args &&...args) |
Output with WARNING level. Messages below the level in MSGTool will be ignored. | |
void | OpenLog (const TString &name) |
Open log file with given file name. | |
MSGTool & | operator= (const MSGTool &msg)=delete |
MSGTool & | operator= (MSGTool &&msg)=delete |
MSGLevel | SetOutputLevel (MSGLevel level) |
Set the output message level. | |
void | StartFocusRegion (const TString &name) |
Start focus region, inside this region the message level would be set to debug. | |
void | StartTitle (const TString &name) |
Start a title with given name. | |
std::unique_ptr< MSGTitleGuard > | StartTitleWithGuard (const TString &title) |
Start a title with given name. | |
Private Member Functions | |
template<typename... Args> | |
void | Print (Args &&...args) |
void | PrintEnd () |
void | PrintLevel (MSGLevel level) |
void | PrintSpace () |
void | PrintTitle () |
Private Attributes | |
MSGLevel | DefinedLevel = MSGLevel::INFO |
TString | FocusName = "UNKNOWN" |
std::vector< TString > | FuncTitle |
bool | isCreateLog = false |
bool | isOpenLog = false |
TString | LogFileName |
std::shared_mutex | MSGMutex |
std::ofstream | outfile |
MSGLevel | OutputLevel = MSGLevel::INFO |
bool | tolog = false |
Friends | |
class | Analysis |
class | ConfigTool |
class | LoopEvent |
MSGTool::MSGTool | ( | MSGLevel | level, |
const TString & | name = "UNKNOWN" |
||
) |
Construct MSGTool with given level, message below this level will not be printed.
level | the message level. |
name | the focus region name. |
Definition at line 14 of file MSGTool.cxx.
MSGTool::MSGTool | ( | const MSGTool & | msg, |
int | ThreadNumber | ||
) |
Construct sub-MSGTool for multi-thread usage.
msg | the mother MSGTool. |
ThreadNumber | the thread number. |
Definition at line 28 of file MSGTool.cxx.
|
default |
|
delete |
|
delete |
MSGTool::~MSGTool | ( | ) |
Definition at line 46 of file MSGTool.cxx.
void MSGTool::CloseLog | ( | ) |
Close the log file.
Definition at line 80 of file MSGTool.cxx.
void MSGTool::CreateLog | ( | const TString & | name | ) |
Create log file with given file name.
name | file name of the log. |
Definition at line 53 of file MSGTool.cxx.
void MSGTool::EndFocusRegion | ( | const TString & | name | ) |
End focus region.
name | name of the focus region. |
Definition at line 103 of file MSGTool.cxx.
void MSGTool::EndTitle | ( | ) |
End the current title.
Definition at line 135 of file MSGTool.cxx.
MSGLevel MSGTool::Level | ( | ) | const |
Get the current message level.
Definition at line 184 of file MSGTool.cxx.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void MSGTool::OpenLog | ( | const TString & | name | ) |
Open log file with given file name.
name | file name of the log. |
Definition at line 67 of file MSGTool.cxx.
|
inlineprivate |
|
private |
Definition at line 159 of file MSGTool.cxx.
|
private |
Definition at line 142 of file MSGTool.cxx.
Set the output message level.
level | message level. |
Definition at line 176 of file MSGTool.cxx.
void MSGTool::StartFocusRegion | ( | const TString & | name | ) |
Start focus region, inside this region the message level would be set to debug.
name | name of the focus region. |
Definition at line 95 of file MSGTool.cxx.
void MSGTool::StartTitle | ( | const TString & | name | ) |
Start a title with given name.
The output should be like
name | title name. |
Definition at line 118 of file MSGTool.cxx.
std::unique_ptr< MSGTool::MSGTitleGuard > MSGTool::StartTitleWithGuard | ( | const TString & | name | ) |
Start a title with given name.
name | the title name. |
Definition at line 127 of file MSGTool.cxx.
|
friend |
|
private |
|
private |