add logger

parent 96021ef7
......@@ -20,6 +20,7 @@ source_files = ['main.cc',
'utils.cc',
'glob_params.cc',
'linalg/storage_matrix.cc',
'givaro_wrapper.cc']
'givaro_wrapper.cc',
'logger.cc']
env.Program('tinygb', source_files)
#include "logger.h"
void Logger::log(const std::string& s) {
std::system(("echo $(date +\"%s\") " + s + " >> " + filename_).c_str());
}
#ifndef LOGGER_H_
#define LOGGER_H_
#include <string>
class Logger {
public:
Logger(const std::string filename)
: filename_(filename) {}
void log(const std::string& s);
private:
std::string filename_;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment