22 std::ofstream BCLog::fOutputStream;
28 bool BCLog::fFirstOutputDone =
false;
30 const char * BCLog::fVersion = VERSION;
32 int BCLog::fHindex = 0;
39 gErrorIgnoreLevel=2000;
52 gErrorIgnoreLevel=2000;
55 BCLog::fOutputStream.open(filename);
57 if (!BCLog::fOutputStream.is_open())
59 std::cerr <<
" Could not open log file " << filename <<
". " << std::endl;
67 BCLog::Out(BCLog::summary,BCLog::summary,Form(
"Opening logfile %s",filename));
72 void BCLog::OpenLog(
const char * filename)
74 BCLog::OpenLog(filename, BCLog::debug, BCLog::summary);
88 return BCLog::fOutputStream.is_open();
95 BCLog::fOutputStream.close();
103 if(!fFirstOutputDone)
110 if (loglevelfile >= BCLog::fMinimumLogLevelFile)
111 BCLog::fOutputStream <<
BCLog::ToString(loglevelfile) <<
" : " << message << std::endl;
115 if (loglevelscreen >= BCLog::fMinimumLogLevelScreen)
116 std::cout <<
BCLog::ToString(loglevelscreen) <<
" : " << message << std::endl;
123 BCLog::Out(BCLog::fMinimumLogLevelFile, BCLog::fMinimumLogLevelScreen, message);
130 char * message = Form(
131 " +------------------------------------------------------+\n"
133 " | BAT version %7s |\n"
134 " | Copyright (C) 2007-2014, the BAT core developer team |\n"
135 " | All rights reserved. |\n"
137 " | For the licensing terms see doc/COPYING |\n"
138 " | For documentation see http://mpp.mpg.de/bat |\n"
140 " +------------------------------------------------------+\n",
144 if (BCLog::fMinimumLogLevelScreen < BCLog::nothing)
145 std::cout << message << std::endl;
147 if (
BCLog::IsOpen() && BCLog::fMinimumLogLevelFile<BCLog::nothing)
148 BCLog::fOutputStream << message;
150 fFirstOutputDone =
true;
176 int printBATUponLoading()
194 static int tmpvarPrint = printBATUponLoading();
static void OpenLog(const char *filename, BCLog::LogLevel loglevelfile, BCLog::LogLevel loglevelscreen)
static void SetLogLevelFile(BCLog::LogLevel loglevel)
static void StartupInfo()
static void Out(BCLog::LogLevel loglevelfile, BCLog::LogLevel loglevelscreen, const char *message)
static void SetLogLevelScreen(BCLog::LogLevel loglevel)
static const char * ToString(BCLog::LogLevel)