-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyLog.cpp
37 lines (30 loc) · 949 Bytes
/
MyLog.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
///
/// src/optlogger/MyLog.cpp
///
/// Written by Roberto Bargetto
/// DIGEP
/// Politecnico di Torino
/// Corso Duca degli Abruzzi, 10129, Torino
/// Italy
///
/// Copyright 2023 by Roberto Bargetto
/// roberto.bargetto@polito.it or roberto.bargetto@gmail.com
///
/// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0)
/// See the license at http://creativecommons.org/licenses/by-nc-sa/4.0/
///
#include "MyLog.h"
bool init_logging (bool close_it, std::string filename, TLogLevel level, std::string md)
{
if(close_it)
{
fflush(Output2FILE::Stream());
return fclose(Output2FILE::Stream());
}
std::stringstream logfnss;
logfnss << "./" << filename;
FILELog::ReportingLevel() = level;
Output2FILE::Stream() = fopen(logfnss.str().c_str(), md.c_str());
//logging_initialized = true;
return true;
}