Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (36 sloc) 0.916 kb
01069b2 Braden McDorman Changing everything
bmcdorman authored
1 #include "log.hpp"
945af55 Braden McDorman Project system is now compiling. Woo\!
bmcdorman authored
2
3 #include <iostream>
4 #include <QTime>
5
6 #define ERROR_PREFIX QString("Error")
7 #define WARNING_PREFIX QString("Warning")
8 #define INFO_PREFIX QString("Info")
9 #define DEBUG_PREFIX QString("Debug")
10
01069b2 Braden McDorman Changing everything
bmcdorman authored
11 using namespace Kiss;
12
945af55 Braden McDorman Project system is now compiling. Woo\!
bmcdorman authored
13 void Log::setLoggingLevel(const int& level)
14 {
15 m_level = level;
16 }
17
18 const int Log::loggingLevel() const
19 {
20 return m_level;
21 }
22
23 void Log::error(const QString& message) const
24 {
25 Log::message(ERROR_PREFIX + ": " + message);
26 }
27
28 void Log::warning(const QString& message) const
29 {
30 Log::message(WARNING_PREFIX + ": " + message);
31 }
32
33 void Log::info(const QString& message) const
34 {
35 Log::message(INFO_PREFIX + ": " + message);
36 }
37
38 void Log::debug(const QString& message) const
39 {
40 Log::message(DEBUG_PREFIX + ": " + message);
41 }
42
43 void Log::message(const QString& message) const
44 {
45 std::cout << "[" << QTime::currentTime().toString().toStdString() << "] " << message.toStdString() << std::endl;
46 }
Something went wrong with that request. Please try again.