sammine-lang
Loading...
Searching...
No Matches
Logging.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3
21
22namespace sammine_log {
24void set_enabled_types(const std::string &types_str);
25
27const std::string &get_enabled_types();
28
30bool is_type_in_list(const char *type, const std::string &list);
31} // namespace sammine_log
32
39#define LOG(X) \
40 do { \
41 if (::sammine_log::is_type_in_list(DEBUG_TYPE, \
42 ::sammine_log::get_enabled_types())) { \
43 X; \
44 } \
45 } while (false)
void set_enabled_types(const std::string &types_str)
Set the enabled debug types from command line (semicolon-separated).
Definition Logging.cpp:14
bool is_type_in_list(const char *type, const std::string &list)
Check if type is in semicolon-separated list.
Definition Logging.cpp:20
const std::string & get_enabled_types()
Get the enabled debug types string.
Definition Logging.cpp:18