Skip to content
Snippets Groups Projects
Commit 890d5043 authored by Mark Woolrich's avatar Mark Woolrich
Browse files

*** empty log message ***

parent 7eb2ea59
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,17 @@ namespace Utilities{
return log;
}
template<class t> Log& operator<<(Log& log, t& obj)
{
if(log.stream_to_logfile)
log.logfileout << obj;
if(log.stream_to_cout)
cout << obj;
return log;
}
class Log
{
public:
......@@ -123,6 +134,9 @@ namespace Utilities{
template<class t>
friend Log& operator<<(Log& log, const t& obj);
template<class t>
friend Log& operator<<(Log& log, t& obj);
};
class LogSingleton
......
......@@ -84,15 +84,17 @@ namespace Utilities{
if(instantstack || runningstack)
{
tmp = "";
pad++;
for(unsigned int i = 0; i < pad; i++)
tmp = tmp + " ";
stk.push(string(str));
if(runningstack)
cout << tmp << str << endl;
{
tmp = "";
pad++;
for(unsigned int i = 0; i < pad; i++)
tmp = tmp + " ";
cout << tmp << str << endl;
}
}
if(timingon)
{
......@@ -116,7 +118,9 @@ namespace Utilities{
virtual ~Time_Tracer()
{
if(instantstack)
stk.pop();
{
stk.pop();
}
if(runningstack && pad > 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment