-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLOG.cpp
More file actions
53 lines (45 loc) · 710 Bytes
/
LOG.cpp
File metadata and controls
53 lines (45 loc) · 710 Bytes
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
#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);
}
}