-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cpp
49 lines (41 loc) · 1.62 KB
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* test.cpp
*
* Created on: 12 Apr 2012
* Author: Climax
*
Copyright 2012 Pieter Jordaan
Distributed under the GNU Lesser General Public License
This file is part of MyLogger.
MyLogger is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MyLogger is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with MyLogger. If not, see <http://www.gnu.org/licenses/>.
*/
#include "logger.hpp"
using namespace chreosis;
int main() {
Logger::instance()->setGlobalSeverity(chreosis::Logger::LogSeverity::LogAlert);
Logger::instance()->AddLogFileOutputStream("logfile1.log", true);
Logger::instance()->AddLogFileOutputStream("logfile2.log", false);
Logger::instance()->AddOutputStream(std::cerr);
Logger::instance()->AddOutputStream(std::cout);
// Without Macro
chreosis::Logger::instance()->Log(chreosis::Logger::LogEmergency, STRSTREAM("whoo" << 123 << "fdsf"),__FILE__, __LINE__, __FUNCTION__ );
// With Macro
MYLOG(chreosis::Logger::LogError, "Whooe" << " this" << " is " << "Awesome!!");
MYLOG_ERROR("Error occured " << true << " " << 9999);
MYLOG_ALERT("Error occured " << true << " " << 9999);
int i = 0;
while(i < 50) {
MYLOG_ALERT_N(5, "every 5 times");
i++;
}
return 0;
}