diff options
Diffstat (limited to 'src/example/log.cpp')
-rw-r--r-- | src/example/log.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/example/log.cpp b/src/example/log.cpp new file mode 100644 index 0000000..04ab9cd --- /dev/null +++ b/src/example/log.cpp @@ -0,0 +1,29 @@ +/** \file + * + * Standalone example for usage of the logging functions + */ + +#include <crepe/api/Config.h> +#include <crepe/util/log.h> + +using namespace crepe; +using namespace crepe::util; + +// unrelated setup code +int _ = [] () { + // make sure all log messages get printed + auto & cfg = api::Config::get_instance(); + cfg.log.level = util::LogLevel::TRACE; + + return 0; // satisfy compiler +} (); + +int main() { + dbg_trace(); + dbg_logf("test printf parameters: %d", 3); + logf(LogLevel::INFO, "info message"); + logf(LogLevel::WARNING, "warning"); + logf(LogLevel::ERROR, "error"); + + return 0; +} |