From 9bdec8c5524e1060e92ee267b57174f7edcee90c Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Thu, 2 Aug 2018 20:59:58 +0000 Subject: [PATCH] Added more code to SDK example. --- src/sdk/example/example.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/sdk/example/example.cpp b/src/sdk/example/example.cpp index 335bb63e9..ad7905e35 100644 --- a/src/sdk/example/example.cpp +++ b/src/sdk/example/example.cpp @@ -73,8 +73,25 @@ void produce() int main() { + // this is needed before using any part of the api utils::init_spark_lib(); - LOG(md, Info, "Hello world"); + + // this is how we log, the first arg is the subsystem, md in your + // case the second is the log level: Diag, Info, Warn, Error, Fatal + // the third argument is a format string, followed by arguments + // (this uses the fmt library see here: https://github.com/fmtlib/fmt + LOG(md, Info, "Hello world, my pid is: {}",getpid()); + + // this is the tracing library we use for performance tuning. + // first two args are special markers just use them as is second + // arg is a const char *, next 3 args are long long see + // https://lttng.org/ for details + tracepoint (bts_trace,trace_order,(char*) "This is a trace example", 0,0, 0); + + // this is an example of our assert macro + bts_assert(true); + + produce(); utils::finit_spark_lib(); return 0;