Commit 03f87a31 authored by Ian Bell's avatar Ian Bell
Browse files

DEBUG. Added empty DEB_SHOW placeholding source files to ReForm project. Added...

DEBUG. Added empty DEB_SHOW placeholding source files to ReForm project. Added std::vector streamer to DEB_out.

[git-p4: depot-paths = "//ReForm/ReForm/main/Base/": change = 10863]
parent 6be0f5a4
set(my_headers
${CMAKE_CURRENT_SOURCE_DIR}/DebOut.hh
${CMAKE_CURRENT_SOURCE_DIR}/DebShow.hh
${CMAKE_CURRENT_SOURCE_DIR}/DebUtils.hh
PARENT_SCOPE
......@@ -7,5 +8,6 @@ set(my_headers
set(my_sources
${CMAKE_CURRENT_SOURCE_DIR}/DebStream.cc
${CMAKE_CURRENT_SOURCE_DIR}/DebShow.cc
PARENT_SCOPE
)
......@@ -12,6 +12,7 @@
#define REFORM_DEBOUT_HH_INCLUDED
// DEB_ON is defined, or not, in Cmakelists.txt for primary project
//#define DEB_ON 1
#ifndef DEB_ON
......@@ -30,6 +31,7 @@
#else // DEB_ON
#include <string>
#include <vector>
#define DEB_module(SS) static const char * l_g_module = SS;
......@@ -131,6 +133,9 @@ public:
HTML = 0x02,
RETAIN = 0x04,
KEEP_OPEN = 0x08
#ifdef DEB_SHOW_ON
, PRIMARY = 0x10
#endif
};
private:
......@@ -147,7 +152,7 @@ public:
) ;
~DebStream();
const char * string_out() const;
const char* string_out() const;
DebStream& print(const int);
DebStream& print(const double);
......@@ -173,6 +178,18 @@ DebStream& operator<<(DebStream& ds, const std::string& s);
DebStream& operator<<(DebStream& ds, const DebCommand& co);
template< typename _Ty>
DebStream& operator<<(DebStream& ds, const std::vector< _Ty >& vec)
{
typename std::vector<_Ty>::const_iterator itr;
ds << "[ ";
for (itr = vec.begin(); itr != vec.end(); ++itr)
ds << *itr << " ";
ds << "]";
return ds;
}
// A std::stream streamer might be useful here. Add when needed.
}//namespace
......
// (C) Copyright 2014 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk, Inc., and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of this information by anyone other than authorized
// employees of Autodesk, Inc. is granted only under a written
// non-disclosure agreement, expressly prescribing the scope
// and manner of such use.
#include "DebShow.hh"
#ifdef DEB_SHOW_ON
// [ code absent ]
#endif // DEB_SHOW_ON
\ No newline at end of file
// (C) Copyright 2014 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk, Inc., and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of this information by anyone other than authorized
// employees of Autodesk, Inc. is granted only under a written
// non-disclosure agreement, expressly prescribing the scope
// and manner of such use.
#pragma once
#ifndef I_DEB_SHOW_HXX
#define I_DEB_SHOW_HXX
// Undefined to inhibit DEB_show code footprint
//#define DEB_SHOW_ON 1
#ifdef DEB_SHOW_ON
// [ code absent ]
#endif // DEB_SHOW_ON
#endif // I_DEB_SHOW_HXX
......@@ -566,6 +566,11 @@ public:
}
add_time(str);
str.append("[ Build: " __TIME__ " " __DATE__ "] ");
#ifdef DEB_SHOW_ON
// Add link in deb_out.htm to deb_show.htm
if (is_html())
str.append(" :: <A HREF=\"ReForm_deb_show.htm\">ReForm_deb_show.htm</A><BR>\n");
#endif
if (is_html()) str.append("<BR>");
str.append("\n");
}
......@@ -735,12 +740,32 @@ public:
set_module_color("CURV", 0x00FFFF);
set_module_color("QMGN", 0xFF00FF);
// Don't set a TEST module colour here because Test is not part of Reform
#if 0 // Such custom setting calls really belong in Test
set_module_level("PARA", 1);
set_module_level("CFLD", 0);
set_module_level("NSLV", 0);
set_module_level("QMGN", 0);
set_module_level("CURV", 5);
set_module_level("SOLV", 0);
set_module_level("FELD", 0);
#endif
}
~DebFile()
{
// The closing of the primary DEB_out file is a good place to flush and close
// any subsidary DEB files
#ifdef DEB_SHOW_ON
if (type_ & DebStream::PRIMARY)
{
DebShow::DebShowStream os;
os << file_name_ << " closing";
DebShow::DEB_show_close(os.string_out());
}
#endif
}
......@@ -959,11 +984,14 @@ DebStream& DebStream::get_global(int _warn)
{
_warn;
// TODO: Replace with a Singleton?? ThreadArray??
#if 1
static DebStream g_ds__("reform_deb_out.txt");
#else
static DebStream g_ds__("reform_deb_out.htm");
#endif
#ifdef DEB_SHOW_ON
static DebStream g_ds__(
"../../../../test/logs/reform_deb_out.htm",
(StreamType)(APPEND | PRIMARY) );
#else // DEB_SHOW_ON
static DebStream g_ds__("reform_deb_out.txt");
#endif // DEB_SHOW_ON
return g_ds__;
}
......
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