Subversion Repositories HomeAutomation

Rev

Rev 1939 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  *
  3.  *  Copyright (C) 2010  Mattias Runge
  4.  *
  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
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  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.,
  17.  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18.  *
  19.  */
  20.  
  21. #include "Logger.h"
  22.  
  23. #include <iostream>
  24. #include <syslog.h>
  25. #include <boost/date_time.hpp>
  26.  
  27. #include "common/log.h"
  28.  
  29. namespace atom {
  30. namespace logging {
  31.  
  32. Logger::Logger(std::string name)
  33. {
  34.   this->name_ = name;
  35.   this->name_.insert(this->name_.end(), 25 - this->name_.size(), ' ');
  36. }
  37.  
  38. Logger::~Logger()
  39. {
  40. }
  41.  
  42. void Logger::Error(std::string message)
  43. {
  44.   log::Error(this->name_, message.c_str());
  45. }
  46.  
  47. void Logger::Warning(std::string message)
  48. {
  49.   log::Warning(this->name_, message.c_str());
  50. }
  51.  
  52. void Logger::Info(std::string message)
  53. {
  54.   log::Info(this->name_, message.c_str());
  55. }
  56.  
  57. void Logger::Debug(std::string message)
  58. {
  59.   log::Debug(this->name_, message.c_str());
  60. }
  61.  
  62. }; // namespace logging
  63. }; // namespace atom
  64.