-
Notifications
You must be signed in to change notification settings - Fork 8
/
Logger.cpp
87 lines (72 loc) · 1.36 KB
/
Logger.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* File: Logger.cpp
* Author: Jan Dufek
*/
#include "Logger.hpp"
Logger::Logger(string name) {
general_log_file.open(name + ".txt");
rudder_log_file.open(name + "_rudder.txt");
throttle_log_file.open(name + "_throttle.txt");
}
Logger::Logger(const Logger& orig) {
}
Logger::~Logger() {
close();
}
/**
* Log string message into general log.
*
* @param message
*/
void Logger::log_general(string message) {
general_log_file << message;
}
/**
* Log double value into general log.
*
* @param message
*/
void Logger::log_general(double message) {
general_log_file << message;
}
/**
* Log rudder string value into rudder log.
*
* @param message
*/
void Logger::log_rudder(string message) {
rudder_log_file << message;
}
/**
* Log rudder double value into rudder log.
*
* @param message
*/
void Logger::log_rudder(double message) {
rudder_log_file << message;
}
/**
* Log throttle string value into throttle log.
*
* @param message
*/
void Logger::log_throttle(string message) {
throttle_log_file << message;
}
/**
* Log throttle double value into throttle log.
*
* @param message
*/
void Logger::log_throttle(double message) {
throttle_log_file << message;
}
/**
* Close log files.
*
*/
void Logger::close() {
general_log_file.close();
rudder_log_file.close();
throttle_log_file.close();
}