proxygen
main.cpp File Reference

Go to the source code of this file.

Functions

 FOLLY_INIT_LOGGING_CONFIG (".=WARNING,folly=INFO; default:async=true,sync_level=WARNING")
 
int main (int argc, char *argv[])
 

Variables

static ExampleObject staticInitialized ("static")
 

Function Documentation

FOLLY_INIT_LOGGING_CONFIG ( . = WARNING,
folly  = INFO; default:async=true 
)
int main ( int  argc,
char *  argv[] 
)

Definition at line 36 of file main.cpp.

References bm::init(), XLOG, and XLOGF.

36  {
37  // Using log macros before calling folly::initLogging() will use the default
38  // log settings defined by folly::initializeLoggerDB(). The default behavior
39  // is to log WARNING+ messages to stderr.
40  XLOG(INFO) << "log messages less than WARNING will be ignored";
41  XLOG(ERR) << "error messages before initLogging() will be logged to stderr";
42 
43  // folly::Init() will automatically initialize the logging settings based on
44  // the FOLLY_INIT_LOGGING_CONFIG declaration above and the --logging command
45  // line flag.
46  auto init = folly::Init(&argc, &argv);
47 
48  // All XLOG() statements in this file will log to the category
49  // folly.logging.example.main
50  XLOG(INFO, "now the normal log settings have been applied");
51 
52  XLOG(DBG1, "log arguments are concatenated: ", 12345, ", ", 92.0);
53  XLOGF(DBG1, "XLOGF supports {}-style formatting: {:.3f}", "python", 1.0 / 3);
54  XLOG(DBG2) << "streaming syntax is also supported: " << 1234;
55  XLOG(DBG2, "if you really want, ", "you can even")
56  << " mix function-style and streaming syntax: " << 42;
57  XLOGF(DBG3, "and {} can mix {} style", "you", "format") << " and streaming";
58 
59  ExampleObject("foo");
60  XLOG(INFO) << "main returning";
61  return 0;
62 }
void init()
char ** argv
#define XLOGF(level, fmt, arg1,...)
Definition: xlog.h:77
#define XLOG(level,...)
Definition: xlog.h:57

Variable Documentation

ExampleObject staticInitialized("static")
static