blob: 97b8df41a672dea3b74b48a4d56ec02284c3b1b8 [file] [log] [blame]
akmhoque53353462014-04-22 08:43:45 -05001#ifndef NLSR_LOGGER_HPP
2#define NLSR_LOGGER_HPP
3
4#define BOOST_LOG_DYN_LINK 1
5#include "boost-log.hpp"
6
7#include <stdexcept>
8#include <string>
9#include <iostream>
10#include <sstream>
11#include <pwd.h>
12#include <cstdlib>
13#include <string>
14#include <unistd.h>
15#include <boost/format.hpp>
16#include <boost/smart_ptr/shared_ptr.hpp>
17#include <boost/date_time/posix_time/posix_time.hpp>
18#include <boost/date_time/local_time/local_time.hpp>
19
20
21
22
23namespace nlsr {
24
25namespace logging = boost::log;
26namespace attrs = boost::log::attributes;
27namespace src = boost::log::sources;
28namespace sinks = boost::log::sinks;
29namespace expr = boost::log::expressions;
30namespace keywords = boost::log::keywords;
31
32using boost::shared_ptr;
33using namespace std;
34
35
36class Logger
37{
38public:
39 Logger()
40 {
41 }
42
43 void
44 initialize(std::string dirPath);
45
46 src::logger&
47 getLogger()
48 {
49 return m_Logger;
50 }
51
52private:
53 string
54 getEpochTime();
55
56 string
57 getUserHomeDirectory();
58
59private:
60 src::logger m_Logger;
61};
62
63}//namespace nlsr
64#endif //NLSR_LOGGER_HPP