X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Fscd_logging.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Fscd_logging.h;h=9112dc8120ccbfe4e01c7d7faa547e2fc8edd95b;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/scd_logging.h b/dol/src/dol/visitor/hdsd/scd/scd_logging.h new file mode 100644 index 0000000..9112dc8 --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/scd_logging.h @@ -0,0 +1,56 @@ +#ifndef SCD_LOGGING_H +#define SCD_LOGGING_H + +#include +using std::string; + +/* Loglevels. Default is SCD_INFO */ +typedef int scd_loglevel; +const scd_loglevel SCD_DEBUG = 0; +const scd_loglevel SCD_INFO = 1; +const scd_loglevel SCD_WARN = 2; +const scd_loglevel SCD_ERROR = 3; + +/** + * Log message if the current loglevel is low enough. + */ +void scd_log(const scd_loglevel &level, const string &str); + +/** + * Log message with loglevel SCD_DEBUG. + */ +inline void scd_debug(const string &str) +{ + scd_log(SCD_DEBUG, str); +} + +/** + * Log message with loglevel SCD_INFO. + */ +inline void scd_info(const string &str) +{ + scd_log(SCD_INFO, str); +} + +/** + * Log message with loglevel SCD_WARN. + */ +inline void scd_warn(const string &str) +{ + scd_log(SCD_WARN, str); +} + +/** + * Log message with loglevel SCD_ERROR. + */ +inline void scd_error(const string &str) +{ + scd_log(SCD_ERROR, str); +} + +/** + * Set the current loglevel. Events with lower priorities are not logged. + */ +void scd_set_loglevel(const scd_loglevel &level); + +#endif