00001 #ifndef __logger_h__
00002 #define __logger_h__
00003
00004 #ifdef HAVE_UNISTD_H
00005 #include <unistd.h>
00006 #endif
00007
00008 #include <iostream>
00009 #include <string>
00010
00011 #include "asserts.h"
00012 #include "types.h"
00013 #include "fs.h"
00014 #include "rconfig.h"
00015
00016
00017 class log_manager {
00018 public:
00019 log_manager();
00020
00021 void clear(void);
00022 void init(void);
00023 const bool initialized(void) const;
00024
00025 void write(
00026 const std::string& a_str,
00027 const uint16 a_indention = 0,
00028 const configuration_manager::logging_type a_logging_level
00029 = configuration_manager::logging_manager,
00030 const pid_t a_pid = pid()
00031 );
00032
00033 private:
00034 bool m_new_line;
00035 std::ofstream m_out;
00036 bool m_initialized;
00037 };
00038
00039 extern log_manager logger;
00040
00041 #endif