From 2d1bf3042b34a844a22c0ca4cda10a09e843460a Mon Sep 17 00:00:00 2001 From: psa-jforestier Date: Tue, 8 Sep 2020 18:20:50 +0200 Subject: [PATCH] improve logging function --- .gitignore | 3 +++ src/util.cpp | 5 +++++ src/util.h | 1 + 3 files changed, 9 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0340b92 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o +*.a +*.gch diff --git a/src/util.cpp b/src/util.cpp index e9e5943..77b55a1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -7,6 +7,11 @@ void dbg_setlevel(int Level) debug_level=Level; } +int dbg_getlevel() +{ + return debug_level; +} + void dbg_printf(int Level, const char *fmt, ...) { if (Level <= debug_level) diff --git a/src/util.h b/src/util.h index 3ed77ae..64c1069 100644 --- a/src/util.h +++ b/src/util.h @@ -5,6 +5,7 @@ #include void dbg_setlevel(int Level); +int dbg_getlevel(); void dbg_printf(int Level, const char *fmt, ...); #endif \ No newline at end of file