Functions
gtestMessenger.cxx File Reference
#include "Framework/Messenger/Messenger.h"

Go to the source code of this file.

Functions

int main (int, char **)
 

Function Documentation

int main ( int  ,
char **   
)

Definition at line 23 of file gtestMessenger.cxx.

24 {
25  LOG("Stream-Name", pFATAL) << "this is a message with priority: FATAL" ;
26  LOG("Stream-Name", pALERT) << "this is a message with priority: ALERT" ;
27  LOG("Stream-Name", pCRIT) << "this is a message with priority: CRIT" ;
28  LOG("Stream-Name", pERROR) << "this is a message with priority: ERROR" ;
29  LOG("Stream-Name", pWARN) << "this is a message with priority: WARN" ;
30  LOG("Stream-Name", pNOTICE) << "this is a message with priority: NOTICE";
31  LOG("Stream-Name", pINFO) << "this is a message with priority: INFO" ;
32  LOG("Stream-Name", pDEBUG) << "this is a message with priority: DEBUG" ;
33 
34  //-- set a "verbosity level" for the "Stream-Name" message stream
35 
36  Messenger * msg = Messenger::Instance();
37  msg->SetPriorityLevel("Stream-Name", pERROR);
38 
39  //-- re-print / some of them must be filtered now
40 
41  LOG("Stream-Name", pFATAL) << "this is another message with priority: FATAL" ;
42  LOG("Stream-Name", pALERT) << "this is another message with priority: ALERT" ;
43  LOG("Stream-Name", pCRIT) << "this is another message with priority: CRIT" ;
44  LOG("Stream-Name", pERROR) << "this is another message with priority: ERROR" ;
45  LOG("Stream-Name", pWARN) << "this is another message with priority: WARN" ;
46  LOG("Stream-Name", pNOTICE) << "this is another message with priority: NOTICE";
47  LOG("Stream-Name", pINFO) << "this is another message with priority: INFO" ;
48  LOG("Stream-Name", pDEBUG) << "this is another message with priority: DEBUG" ;
49 
50  //-- set pririty level to minimum
51 
52  msg->SetPriorityLevel("Stream-Name", pDEBUG);
53 
54  //-- try different pre-processor macros for printing out messages
55 
56  LOG_FATAL ("Stream-Name") << "this is yet another message with priority: FATAL" ;
57  LOG_ALERT ("Stream-Name") << "this is yet another message with priority: ALERT" ;
58  LOG_CRIT ("Stream-Name") << "this is yet another message with priority: CRIT" ;
59  LOG_ERROR ("Stream-Name") << "this is yet another message with priority: ERROR" ;
60  LOG_WARN ("Stream-Name") << "this is yet another message with priority: WARN" ;
61  LOG_NOTICE ("Stream-Name") << "this is yet another message with priority: NOTICE";
62  LOG_INFO ("Stream-Name") << "this is yet another message with priority: INFO" ;
63  LOG_DEBUG ("Stream-Name") << "this is yet another message with priority: DEBUG" ;
64 
65  return 0;
66 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:147
#define LOG_FATAL(stream)
Definition: Messenger.h:112
#define pERROR
Definition: Messenger.h:59
void msg(const char *fmt,...)
Definition: message.cpp:107
#define pFATAL
Definition: Messenger.h:56
#define LOG_WARN(stream)
Definition: Messenger.h:132
#define LOG_CRIT(stream)
Definition: Messenger.h:122
#define pALERT
Definition: Messenger.h:57
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
#define LOG_ALERT(stream)
Definition: Messenger.h:117
#define pWARN
Definition: Messenger.h:60
A more convenient interface to the log4cpp Message Service.
Definition: Messenger.h:258
void SetPriorityLevel(const char *stream, log4cpp::Priority::Value p)
Definition: Messenger.cxx:88
#define LOG_NOTICE(stream)
Definition: Messenger.h:137
#define pNOTICE
Definition: Messenger.h:61
#define LOG_INFO(stream)
Definition: Messenger.h:142
#define pCRIT
Definition: Messenger.h:58
#define LOG_ERROR(stream)
Definition: Messenger.h:127
#define pDEBUG
Definition: Messenger.h:63