mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-04-10 03:16:01 +00:00
lots of work
This commit is contained in:
@@ -6,28 +6,13 @@
|
||||
#include <fstream>
|
||||
#include "logger.h"
|
||||
#include <string>
|
||||
void addToLog(basic_string<char> Data);
|
||||
void addToLog(const std::string& Data);
|
||||
using namespace std;
|
||||
int loggerlevel;
|
||||
|
||||
void setLoggerLevel(char level_string[]) {
|
||||
if (!strcmp(level_string, "ALL"))
|
||||
loggerlevel = 0;
|
||||
|
||||
if (!strcmp(level_string, "DEBUG"))
|
||||
loggerlevel = 1;
|
||||
|
||||
if (!strcmp(level_string, "INFO"))
|
||||
loggerlevel = 2;
|
||||
|
||||
if (!strcmp(level_string, "WARN"))
|
||||
loggerlevel = 3;
|
||||
|
||||
if (!strcmp(level_string, "ERROR"))
|
||||
loggerlevel = 4;
|
||||
|
||||
if (!strcmp(level_string, "OFF"))
|
||||
loggerlevel = 5;
|
||||
void setLoggerLevel(int level) {
|
||||
//0 ALL 1 DEBUG 2 INFO 3 WARN 4 ERROR 5 OFF
|
||||
loggerlevel = level;
|
||||
}
|
||||
|
||||
stringstream getDate() {
|
||||
@@ -75,13 +60,6 @@ stringstream getDate() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void info(const std::string& toPrint) {
|
||||
if (loggerlevel <= 2){
|
||||
cout << getDate().str() << "[INFO] " << toPrint << endl;
|
||||
|
||||
Reference in New Issue
Block a user