summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/Printer.h7
-rw-r--r--src/Printer.cc4
2 files changed, 7 insertions, 4 deletions
diff --git a/includes/Printer.h b/includes/Printer.h
index 2717a84..f1897d3 100644
--- a/includes/Printer.h
+++ b/includes/Printer.h
@@ -44,10 +44,6 @@ enum {
};
class Printer {
- protected:
- virtual void _print(const char * fmt, va_list ap);
-
- private:
void _print(const char * fmt, ...);
void _log(uint32_t level, const char * fmt, va_list ap);
@@ -56,6 +52,7 @@ class Printer {
Printer();
void setLocal();
+ void setGlobal();
static Printer * getPrinter();
static void log(uint32_t level, const String & fmt, ...) { va_list ap; va_start(ap, fmt); vlog(level, fmt.to_charp(), ap); va_end(ap); }
@@ -76,6 +73,8 @@ class Printer {
static void setDetailled(bool enable) { getPrinter()->m_detailledLogs = enable; }
+ virtual void _print(const char * fmt, va_list ap);
+
private:
uint32_t m_verbosity = M_STATUS | M_WARNING | M_ERROR | M_ENGINE_DEBUG;
bool m_detailledLogs = false;
diff --git a/src/Printer.cc b/src/Printer.cc
index a7fee9f..7eb02d8 100644
--- a/src/Printer.cc
+++ b/src/Printer.cc
@@ -28,6 +28,10 @@ void Balau::Printer::setLocal() {
localPrinter.set(this);
}
+void Balau::Printer::setGlobal() {
+ localPrinter.setGlobal(this);
+}
+
Balau::Printer * Balau::Printer::getPrinter() { return localPrinter.get(); }
void Balau::Printer::_log(uint32_t level, const char * fmt, va_list ap) {