Commit 2ede7947 authored by Seblu's avatar Seblu
Browse files

Amelioration du system de log

parent 5384d11d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
#include "error.hh"
#include "log.hh"

Error::Error(int i, const string s)
{
@@ -15,7 +16,7 @@ Error::Error(const Error &e)
void Error::print() const
{
  if (msg_.str() != "")
    std::cerr << msg_.str() << "." << std::endl;
    logerr << msg_.str() << ".\n";
}

string Error::message() const
+0 −1
Original line number Diff line number Diff line
#include <unistd.h>
#include <iostream>
#include <fstream>
#include "error.h"
#include "log.hh"

+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
# define LOG_HH

#include <ostream>
#include <fstream>

typedef std::string string;
typedef std::ostream ostream;
@@ -16,7 +17,6 @@ public:
  bool file(const string &);
  bool has_file() const;

  friend Logger &operator<<(Logger &l, ostream &s);
  friend Logger &operator<<(Logger &l, const string &s);
  friend Logger &operator<<(Logger &l, const char *s);
  friend Logger &operator<<(Logger &l, int i);
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ Options Options::getoptions(const string file) {
    else if (!strcasecmp(name, "logfile"))
      this->logfile = value;
    else
      std::cerr << "Invalid line " << i << ": " << line << std::endl;
      logerr << "Invalid line " << i << ": " << line << "\n";
  }

  fs.close();