![]() |
|
|
Generated: 8 Jan 2009 |
#include <string>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cctype>
#include "GaudiKernel/IMessageSvc.h"
#include "GaudiKernel/Message.h"
#include "GaudiKernel/Timing.h"
#include "GaudiKernel/time_r.h"

Go to the source code of this file.
Defines | |
| #define | SET(x) case x: level=#x; break |
Functions | |
| std::string | formattedTime (std::string fmt, bool universal=false) |
| std::ostream & | operator<< (std::ostream &stream, const Message &msg) |
| bool | operator== (const Message &a, const Message &b) |
| std::string | formattedTime (std::string fmt, bool universal) |
| #define SET | ( | x | ) | case x: level=#x; break |
| std::string @395::formattedTime | ( | std::string | fmt, | |
| bool | universal | |||
| ) | [static] |
Definition at line 456 of file Message.cpp.
00457 { 00458 // get current time in milliseconds 00459 longlong t = System::currentTime( System::milliSec ); 00460 int msec = static_cast<int>(t % 1000); 00461 time_t sec = static_cast<time_t>(t / 1000); 00462 00463 // convert to break-down time 00464 struct tm tms ; 00465 if (universal) { 00466 gmtime_r( &sec, &tms ); 00467 } else { 00468 localtime_r( &sec, &tms ); 00469 } 00470 00471 // replace %f in the format string with miliseconds 00472 std::string::size_type n = fmt.find("%f") ; 00473 if ( n != std::string::npos ) { 00474 char subs[4] ; 00475 sprintf ( subs, "%03d", msec ) ; 00476 while ( n != std::string::npos ) { 00477 fmt.replace ( n, 2, subs ) ; 00478 n = fmt.find("%f") ; 00479 } 00480 } 00481 00482 char buf[128] ; 00483 strftime(buf, 128, fmt.c_str(), &tms ); 00484 return std::string( buf ); 00485 }
| std::string @395::formattedTime | ( | std::string | fmt, | |
| bool | universal = false | |||
| ) | [static] |
| std::ostream& operator<< | ( | std::ostream & | stream, | |
| const Message & | msg | |||
| ) |
Definition at line 148 of file Message.cpp.
00149 { 00150 msg.makeFormattedMsg( msg.m_format ); 00151 stream << msg.m_formatted_msg; 00152 return stream; 00153 }