Subversion Repositories HomeAutomation

Rev

Rev 1964 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1964 Rev 2066
1
/*
1
/*
2
 *
2
 *
3
 *  Copyright (C) 2010  Mattias Runge
3
 *  Copyright (C) 2010  Mattias Runge
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
9
 *
9
 *
10
 *  This program is distributed in the hope that it will be useful,
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
13
 *  GNU General Public License for more details.
14
 *
14
 *
15
 *  You should have received a copy of the GNU General Public License along
15
 *  You should have received a copy of the GNU General Public License along
16
 *  with this program; if not, write to the Free Software Foundation, Inc.,
16
 *  with this program; if not, write to the Free Software Foundation, Inc.,
17
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
 *
18
 *
19
 */
19
 */
20
 
20
 
21
#include "Logger.h"
21
#include "Logger.h"
22
 
22
 
23
#include <iostream>
23
#include <iostream>
24
#include <syslog.h>
24
#include <syslog.h>
25
#include <boost/date_time.hpp>
25
#include <boost/date_time.hpp>
26
 
26
 
27
#include "common/log.h"
27
#include "common/log.h"
28
 
28
 
29
namespace atom {
29
namespace atom {
30
namespace logging {
30
namespace logging {
31
 
31
 
32
Logger::Logger(std::string name)
32
Logger::Logger(std::string name)
33
{
33
{
34
  this->name_ = name;
34
  this->name_ = name;
35
  this->name_.insert(this->name_.end(), 25 - this->name_.size(), ' ');
35
  this->name_.insert(this->name_.end(), 25 - this->name_.size(), ' ');
36
}
36
}
37
 
37
 
38
Logger::~Logger()
38
Logger::~Logger()
39
{
39
{
40
}
40
}
41
 
41
 
42
void Logger::Error(std::string message)
42
void Logger::Error(std::string message)
43
{
43
{
44
  log::Error(this->name_, message.c_str());
44
  log::Error(this->name_, message.c_str());
45
}
45
}
46
 
46
 
47
void Logger::Warning(std::string message)
47
void Logger::Warning(std::string message)
48
{
48
{
49
  log::Warning(this->name_, message.c_str());
49
  log::Warning(this->name_, message.c_str());
50
}
50
}
51
 
51
 
52
void Logger::Info(std::string message)
52
void Logger::Info(std::string message)
53
{
53
{
54
  log::Info(this->name_, message.c_str());
54
  log::Info(this->name_, message.c_str());
55
}
55
}
56
 
56
 
57
void Logger::Debug(std::string message)
57
void Logger::Debug(std::string message)
58
{
58
{
59
  log::Debug(this->name_, message.c_str());
59
  log::Debug(this->name_, message.c_str());
-
 
60
}
-
 
61
 
-
 
62
void Logger::Extreme(std::string message)
-
 
63
{
-
 
64
  log::Extreme(this->name_, message.c_str());
60
}
65
}
61
 
66
 
62
}; // namespace logging
67
}; // namespace logging
63
}; // namespace atom
68
}; // namespace atom
64
 
69