diff options
Diffstat (limited to 'src/example/log.cpp')
-rw-r--r-- | src/example/log.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/example/log.cpp b/src/example/log.cpp new file mode 100644 index 0000000..3bc6d80 --- /dev/null +++ b/src/example/log.cpp @@ -0,0 +1,24 @@ +/** \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; + +int main() { + auto & cfg = api::Config::get_instance(); + // make sure all log messages get printed + cfg.log.level = util::LogLevel::TRACE; + + dbg_trace(); + dbg_logf("cfg.log.color is equal to %d", cfg.log.color); + logf(LogLevel::INFO, "info message!"); + logf(LogLevel::WARNING, "very scary warning"); + logf(LogLevel::ERROR, "fatal error!!!"); + + return 0; +} |