summaryrefslogtreecommitdiff
path: root/i/chuck/src/log/logger_null.hh
diff options
context:
space:
mode:
Diffstat (limited to 'i/chuck/src/log/logger_null.hh')
-rw-r--r--i/chuck/src/log/logger_null.hh51
1 files changed, 51 insertions, 0 deletions
diff --git a/i/chuck/src/log/logger_null.hh b/i/chuck/src/log/logger_null.hh
new file mode 100644
index 0000000..03c71a6
--- /dev/null
+++ b/i/chuck/src/log/logger_null.hh
@@ -0,0 +1,51 @@
+#ifndef logger_null_hh
+#define logger_null_hh
+// logger_null.hh
+// marvin - programme du robot 2006. {{{
+//
+// Copyright (C) 2006 Dufour Jérémy
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// Contact :
+// Web: %WEB%
+// Email: <dufourj@efrei.fr>
+// }}}
+
+#include "logger.hh"
+
+/// Null logger to prevent losing time.
+class LoggerNull : public Logger
+{
+ public:
+ /// Default empty constructor.
+ LoggerNull (void) { }
+ /// Default empty destructor.
+ ~LoggerNull (void) { }
+ /// Empty start.
+ void start (const Log &, const char *, Log::Level) { }
+ /// Empty stop.
+ void stop (void) { }
+ /// Empty << string or variable name.
+ LoggerNull &operator<< (const char *) { return *this; }
+ /// Empty << string or variable name.
+ LoggerNull &operator<< (const std::string &) { return *this; }
+ /// Empty << integer.
+ LoggerNull &operator<< (int) { return *this; }
+ /// Empty << double.
+ LoggerNull &operator << (double) { return *this; }
+};
+
+#endif // logger_null_hh