Skip to content

Commit

Permalink
Logger header file
Browse files Browse the repository at this point in the history
  • Loading branch information
ncc14003 committed Feb 5, 2020
1 parent 8d66382 commit 3b5bad7
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions breadcrumbs/include/Logger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef LOGGER_HPP
#define LOGGER_HPP

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>

using namespace std;



class Logger {
public:
int logging_Level = 1;
string filename = "log.txt";


};

void write_log(string msg, int msg_level, string filename, Logger* logObject) {
string line;
ofstream log_file;
log_file.open(filename, std::ios_base::app);
if (logObject->logging_Level <= msg_level) {
//for (int i = 0; i < &msg.size; i++)
log_file << msg;

}
log_file.close();
}

Logger* logger = NULL;
Logger* getLogger() {
if (logger == NULL) {
logger = new Logger();

}
return logger;
}

//Logger* logger = getLogger();
#endif

0 comments on commit 3b5bad7

Please sign in to comment.