AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
logger.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include <iostream>
23#include <sstream>
24#include <vector>
25
26#include "logger/levels.hpp"
27#include "logger/writer.hpp"
28
29namespace anch::logger {
30
45 class Logger {
46 // Attributes +
47 private:
49 std::string _name;
50
53
55 std::vector<anch::logger::Writer*> _writers;
56 // Attributes -
57
58 // Constructors +
59 public:
67 Logger(const std::string& name,
68 const anch::logger::Level level,
69 const std::vector<anch::logger::Writer*>& writers);
70 // Constructors -
71
72 // Destructor +
76 virtual ~Logger();
77 // Destructor -
78
79 // Methods +
80 public:
87 template<typename T, typename... Q>
88 void trace(const T& value, const Q&... values) const noexcept;
89
96 template<typename T, typename... Q>
97 void debug(const T& value, const Q&... values) const noexcept;
98
105 template<typename T, typename... Q>
106 void info(const T& value, const Q&... values) const noexcept;
107
114 template<typename T, typename... Q>
115 void warn(const T& value, const Q&... values) const noexcept;
116
123 template<typename T, typename... Q>
124 void error(const T& value, const Q&... values) const noexcept;
125
132 template<typename T, typename... Q>
133 void fatal(const T& value, const Q&... values) const noexcept;
134
135 private:
144 template<typename T>
145 void log(const Level& level,
146 std::ostringstream& out,
147 const T& value) const noexcept;
148
156 template<typename T, typename... Q>
157 void log(const Level& level,
158 const T& value,
159 const Q&... values) const noexcept;
160
169 template<typename T, typename... Q>
170 void log(const Level& level,
171 std::ostringstream& out,
172 const T& value,
173 const Q&... values) const noexcept;
174 // Methods -
175
176 };
177
178}
179
180#include "logger/impl/logger.hpp"
void debug(const T &value, const Q &... values) const noexcept
Logger(const std::string &name, const anch::logger::Level level, const std::vector< anch::logger::Writer * > &writers)
void info(const T &value, const Q &... values) const noexcept
void fatal(const T &value, const Q &... values) const noexcept
void trace(const T &value, const Q &... values) const noexcept
void warn(const T &value, const Q &... values) const noexcept
void error(const T &value, const Q &... values) const noexcept
Logger namespace.
Definition anchDateFormatter.hpp:27
Level
Definition levels.hpp:32