Commit 86b6d2bd authored by Ian Bell's avatar Ian Bell
Browse files

DEBUG. Increased build warning level to \W4. Added some missing linefeeds to...

DEBUG. Increased build warning level to \W4. Added some missing linefeeds to new DEB_out streaming. Raised level of TRACE_GUROBI_INPUT deb out to 7 and decerased default DEB_out level to 5 so as to redisable this output by default.
 No behaviour changes anticipated other than changed DEB_out content.

[git-p4: depot-paths = "//ReForm/ReForm/main/Base/": change = 10448]
parent f5c4ee8a
......@@ -16,7 +16,7 @@ if (MSVC)
add_definitions(-D_USE_MATH_DEFINES)
add_definitions(-DNOMINMAX)
add_definitions(/W1) #add appropriate warnings flags for this project, the compilation raises too may warnings
add_definitions(/W4)
add_definitions(/MP) #build on all cores
endif (MSVC)
......@@ -292,10 +292,10 @@ public:
CallStack& call_stack() { return call_stack_;}
bool is_kept_open() const { return type_ & StreamType::keep_open; }
bool is_html() const { return type_ & StreamType::html; }
bool is_retained() const { return type_ & StreamType::retain; }
bool is_appended() const { return type_ & StreamType::append; }
bool is_kept_open() const { return 0 != (type_ & StreamType::keep_open); }
bool is_html() const { return 0 != (type_ & StreamType::html); }
bool is_retained() const { return 0 != (type_ & StreamType::retain); }
bool is_appended() const { return 0 != (type_ & StreamType::append); }
// Only applies to HTML DEB_out
bool is_white_on_black() { return true; }
......@@ -322,7 +322,7 @@ public:
DebStream* _deb_stream,
StreamType _type = (StreamType) (append | retain),
const char * _file_name = nullptr) :
type_(_type), lev_(9), deb_stream_(_deb_stream), num_flush_(0)
type_(_type), lev_(5), deb_stream_(_deb_stream), num_flush_(0)
{
set_file_name(_file_name);
indent_string_ = ".";
......@@ -394,9 +394,28 @@ public:
print(buffer);
}
DebStream & stream() { return *deb_stream_; }
// Append current asctime to given string
bool add_time(std::string & str)
{
time_t rawtime;
time ( &rawtime );
struct tm timeinfo;
errno_t err = localtime_s( &timeinfo, &rawtime );
if (err == 0)
{
char buffer[256];
err = asctime_s(buffer, sizeof(buffer), &timeinfo);
if (err == 0)
{
str.append( buffer );
return true;
}
}
return false;
}
void header(std::string & str)
{
if ( is_html() )
......@@ -422,11 +441,7 @@ public:
bool date_header = true;
if (date_header)
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
str.append( asctime (timeinfo) );
add_time(str);
str.append( "[ Build: " __TIME__ " " __DATE__ "] \n");
}
}
......@@ -436,11 +451,9 @@ public:
bool date_footer = true;
if (date_footer)
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
stream() << " \n Closed: " << asctime (timeinfo) << "\n" ;
std::string str = " \n Closed: ";
add_time(str);
stream() << str << "\n";
}
if (is_html())
......@@ -525,10 +538,8 @@ public:
type_ = (StreamType)(type_ | StreamType::html);
}
}; // endclass DebStream::Impl
// =====================================
// DebEnter member funcs
// =====================================
......
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