forked from PlatformLab/NanoLog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NanoLog.cc
52 lines (42 loc) · 1.35 KB
/
NanoLog.cc
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
#include "NanoLog.h"
#include "RuntimeLogger.h"
/**
* This file implements the public API to NanoLog
*/
namespace NanoLog {
using namespace NanoLogInternal;
std::string getStats() {
return RuntimeLogger::getStats();
}
void printConfig() {
printf("==== NanoLog Configuration ====\r\n");
printf("StagingBuffer size: %u MB\r\n",
NanoLogConfig::STAGING_BUFFER_SIZE / 1000000);
printf("Output Buffer size: %u MB\r\n",
NanoLogConfig::OUTPUT_BUFFER_SIZE / 1000000);
printf("Release Threshold : %u MB\r\n",
NanoLogConfig::RELEASE_THRESHOLD / 1000000);
printf("Idle Poll Interval: %u µs\r\n",
NanoLogConfig::POLL_INTERVAL_NO_WORK_US);
printf("IO Poll Interval : %u µs\r\n",
NanoLogConfig::POLL_INTERVAL_DURING_IO_US);
}
void preallocate() {
RuntimeLogger::preallocate();
}
void setLogFile(const char *filename) {
RuntimeLogger::setLogFile(filename);
}
LogLevel getLogLevel() {
return RuntimeLogger::getLogLevel();
}
void setLogLevel(LogLevel logLevel) {
RuntimeLogger::setLogLevel(logLevel);
}
void sync() {
RuntimeLogger::sync();
}
int getCoreIdOfBackgroundThread() {
return RuntimeLogger::getCoreIdOfBackgroundThread();
}
};