53#define MR_LOG(tag, msg) do { *(BESLog::TheLog()) << "trace-" << tag << BESLog::mark << __FILE__ << BESLog::mark << __LINE__ << BESLog::mark << msg ; BESLog::TheLog()->flush_me() ; } while( 0 )
56#define MR_LOG(tag, msg) do { *(BESLog::TheLog()) << tag << BESLog::mark << msg ; BESLog::TheLog()->flush_me() ; } while( 0 )
58#define MR_LOG(tag, msg) do { *(BESLog::TheLog()) << msg ; BESLog::TheLog()->flush_me() ; } while( 0 )
62#define REQUEST_LOG(x) MR_LOG("request", x)
63#define INFO_LOG(x) MR_LOG("info", x)
64#define ERROR_LOG(x) MR_LOG("error", x)
65#define VERBOSE(x) do { if (BESLog::TheLog()->is_verbose()) MR_LOG("verbose", x); } while( 0 )
72#define LOG(x) do { *(BESLog::TheLog()) << __FILE__ << ":" << __LINE__ << " - " << x ; BESLog::TheLog()->flush_me() ; } while( 0 )
73#define VERBOSE(x) do { if (BESLog::TheLog()->is_verbose()) *(BESLog::TheLog()) << __FILE__ << ":" << __LINE__ << " - " << x ; BESLog::TheLog()->flush_me() ; } while( 0 )
75#define LOG(x) do { *(BESLog::TheLog()) << x ; BESLog::TheLog()->flush_me() ; } while( 0 )
76#define VERBOSE(x) do { if (BESLog::TheLog()->is_verbose()) *(BESLog::TheLog()) << x ; BESLog::TheLog()->flush_me() ; } while( 0 )
82#define ERROR(x) LOG(x)
132 static BESLog * d_instance;
135 std::ofstream * d_file_buffer;
136 std::string d_file_name;
144 bool d_use_local_time;
146 bool d_use_unix_time;
156 const static std::string mark;
220 typedef std::ios& (*p_ios_manipulator)(std::ios&);
222 typedef std::ostream& (*p_ostream_manipulator)(std::ostream&);
238 virtual void dump(std::ostream &strm)
const;
240 virtual void flush_me();
247 std::ostream *get_log_ostream()
249 return d_file_buffer;
Provides a mechanism for applications to log information to an external file.
std::ostream &(* p_ostream_manipulator)(std::ostream &)
Defines a data type p_std::ostream_manipulator "pointer to function that takes std::ostream& and retu...
std::ios &(* p_ios_manipulator)(std::ios &)
Defines a data type p_ios_manipulator "pointer to function that takes ios& and returns ios&".
void dump_time()
Protected method that dumps the date/time to the log file.
BESLog & operator<<(std::string &)
Overloaded inserter that writes the specified string.
void resume()
Resumes logging after being suspended.
void suspend()
Suspend logging of any information until resumed.
void verbose_on()
turn on verbose logging
~BESLog()
Cleans up the logging mechanism.
void verbose_off()
turns off verbose logging
BESLog()
constructor that sets up logging for the application.
bool is_verbose()
Returns true if verbose logging is requested.
virtual void dump(std::ostream &strm) const
dumps information about this object
top level BES object to house generic methods