Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

Fix issue #29 #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions core/lib/Utilities/logstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ template <class T> class Log
/// string stream to which output is written; destructor will dump to log stream.
std::ostringstream os;

#ifdef WIN32 // see kludge note below
#if !defined(USEKLUDGE) && defined(WIN32) && !(defined(__MINGW32__) || defined(__MINGW64__))
#define USEKLUDGE
#endif

#ifdef USEKLUDGE // see kludge note below
static LogLevel reportingLevel; ///< static data for ReportingLevel()
static bool dumpTimeTags; ///< static data for ReportTimeTags()
static bool dumpLevels; ///< static data for ReportLevels()
Expand Down Expand Up @@ -112,23 +116,23 @@ template <class T> Log<T>::~Log()

template <class T> bool& Log<T>::ReportLevels()
{
#ifndef WIN32 // see kludge note below
#ifndef USEKLUDGE // see kludge note below
static bool dumpLevels = false;
#endif
return dumpLevels;
}

template <class T> bool& Log<T>::ReportTimeTags()
{
#ifndef WIN32 // see kludge note below
#ifndef USEKLUDGE // see kludge note below
static bool dumpTimeTags = false;
#endif
return dumpTimeTags;
}

template <class T> LogLevel& Log<T>::ReportingLevel()
{
#ifndef WIN32 // see kludge note below
#ifndef USEKLUDGE // see kludge note below
static LogLevel reportingLevel = INFO; // FILELOG_MAX_LEVEL;
#endif
return reportingLevel;
Expand Down Expand Up @@ -317,7 +321,7 @@ class ConfigureLOG : public Log<ConfigureLOGstream> {
// include file means that it occurs more than once - in every module in which it
// appears. However Windows allows this; hence I have commented out the inner macro
// here. Ah, the joys of developing under MS....
#ifdef WIN32
#ifdef USEKLUDGE
//#ifndef LOGSTREAM_INITIALIZE_REPORTING_LEVEL
//#define LOGSTREAM_INITIALIZE_REPORTING_LEVEL
template<> LogLevel Log<ConfigureLOGstream>::reportingLevel = INFO;
Expand Down