-
Notifications
You must be signed in to change notification settings - Fork 15
/
LOG.cpp
59 lines (51 loc) · 995 Bytes
/
LOG.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
50
51
52
53
54
55
56
57
58
59
/*
LOG.cpp - Library for standard logging convention.
Created by Meir Michanie, June 9, 2010.
Released into the public domain.
Version 0.1
*/
#include "LOG.h"
LOG::LOG(int level)
{
setLevel(level);
}
void LOG::DATA(const char* string)
{
if (_level > 4) {
Serial.print(string);
}
}
void LOG::DATA(int number)
{
if (_level > 4) {
Serial.print(number);
}
}
void LOG::DEBUG(const char* string)
{
if (_level > 3) {
Serial.print("\n[DEBUG]: ");
Serial.println(string);
}
}
void LOG::INFO(const char* string)
{
if (_level > 2) {
Serial.print("\n[INFO]: ");
Serial.println(string);
}
}
void LOG::WARNING(const char* string)
{
if (_level > 1) {
Serial.print("\n[WARNING]: ");
Serial.println(string);
}
}
void LOG::CRITICAL(const char* string)
{
if (_level > 0) {
Serial.print("\n[CRITICAL]: ");
Serial.println(string);
}
}