3460
|
1 #pragma once
|
|
2
|
|
3 #include "ILogger.h"
|
|
4
|
|
5 namespace OrthancHelpers
|
|
6 {
|
|
7 // a logger ... that does not log.
|
|
8 // Instead of writing:
|
|
9 // if (logger != NULL)
|
|
10 // {
|
|
11 // logger->Info("hello") ;
|
|
12 // }
|
|
13 // you should create a NullLogger:
|
|
14 // logger = new NullLogger();
|
|
15 // ...
|
|
16 // logger->Info("hello");
|
|
17 class NullLogger : public BaseLogger {
|
|
18 public:
|
|
19 NullLogger() {}
|
|
20
|
|
21 virtual void Trace(const char* message) {}
|
|
22 virtual void Trace(const std::string& message) {}
|
|
23 virtual void Info(const char* message) {}
|
|
24 virtual void Info(const std::string& message) {}
|
|
25 virtual void Warning(const char* message) {}
|
|
26 virtual void Warning(const std::string& message) {}
|
|
27 virtual void Error(const char* message) {}
|
|
28 virtual void Error(const std::string& message) {}
|
|
29 };
|
|
30 }
|