Example program to test message logging.
More...
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Example program to test message logging.
- Author
- mdejong
Definition in file JMessageLogger.cc.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 20 of file JMessageLogger.cc.
24 string message_logger;
32 JParser<> zap(
"Example program to test message logging.");
34 zap[
'M'] =
make_field(message_logger) =
"localhost";
42 catch(
const exception &error) {
43 FATAL(error.what() << endl);
53 out =
new JStreamLogger(cout);
55 out =
new JControlHostLogger(message_logger);
57 JMessageLogger logger(out, argv[0],
debug);
60 logger.setLevel(JMessageLogger::OFF);
65 logger.debug (
"hello world");
66 logger.warning(
"hello world");
67 logger.error (
"hello world");
68 logger.notice (
"hello world");
69 logger.status (
"hello world");
71 JErrorStream(logger) <<
"hello" <<
' ' <<
"world" <<
' ' << hex << 15;
75 for (
string buffer; ; ) {
77 cout <<
"> " << flush;
82 logger.notice(buffer);
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.