43 sink_ << tv.
fmtString (
"%m/%d/%Y %H:%M:%S") <<
'.';
44 char oldfill = sink_.fill(
'0');
45 sink_ << std::setw (3) << (tv.
msec () % 1000000)/1000 <<
' ';
55 const string& func_name_,
61 if (func_name_.size ()) {
63 while (i < indent_level_) {
71 sink_ <<
'/' << func_name_ <<
" ";
74 sink_ <<
'\\' << func_name_ <<
" ";
77 sink_ <<
'[' << func_name_ <<
"] ";
79 bytecount += indent_level_ *
m_indent_step + func_name_.size () + 3;
98 msg =
new char [expected_sz_];
102 ret = ::vsnprintf (msg, expected_sz_, fmt_, vap_);
105 std::cout <<
"Logger_Impl: format_mg(expected_sz=" << expected_sz_
106 <<
")=-1 failed! errno=" << errno <<
" ("
111 return (ret < 0 ? NULL : msg);
Class TimeVal is a wrapper around UNIX timeval structure.
char * format_msg(size_t expected_sz_, const char *fmt_, va_list vap_, bool &release_)
Format and put the message in the buffer.
virtual u_short indent_func_name(ostream &sink_, const string &funcname_, size_t indent_level_, marker_t type_)
u_short m_indent_step
Indentation step.
int m_tz
Timezone: 0-GMT, 1-Local.
bool timestamp_enabled(void) const
static char m_msgbuf[LOGGER_MAXLINE]
Static buffer for formatted message.
static const unsigned int LOGGER_MAXLINE
Maximum length of the formatted message.
virtual u_short add_timestamp(ostream &sink_)
void tz(int tz_)
Set timezone.
string fmtString(const char *fmt_=NULL) const
Format timeval structure into readable format.
static TimeVal gettimeofday()
Shields off underlying OS differences in getting current time.
void msec(long msec_)
Set microseconds.
Socket & flush(Socket &os_)
flush manipulator.