atscppapi  1.0.9
C++ wrapper for Apache Traffic Server API
 All Classes Files Functions Enumerations Enumerator Macros
Classes | Macros
Logger.cc File Reference
#include "atscppapi/Logger.h"
#include <cstdarg>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <ts/ts.h>
#include "atscppapi/noncopyable.h"
#include "logging_internal.h"

Macros

#define TS_TEXT_LOG_OBJECT_WRITE(level)
 

Detailed Description

Author
Brian Geffon
Manjesh Nilange
Warning
log rolling doesn't work correctly in 3.2.x see: https://issues.apache.org/jira/browse/TS-1813 Apply the patch in TS-1813 to correct log rolling in 3.2.x

Macro Definition Documentation

#define TS_TEXT_LOG_OBJECT_WRITE (   level)
Value:
char buffer[DEFAULT_BUFFER_SIZE_FOR_VARARGS]; \
int n; \
va_list ap; \
while (true) { \
va_start(ap, fmt); \
n = vsnprintf (&buffer[0], sizeof(buffer), fmt, ap); \
va_end(ap); \
if (n > -1 && n < sizeof(buffer)) { \
LOG_DEBUG("logging a " level " to '%s' with length %d", state_->filename_.c_str(), n); \
TSTextLogObjectWrite(state_->text_log_obj_, const_cast<char*>("[" level "] %s"), buffer); \
} else { \
LOG_ERROR("Unable to log " level " message to '%s' due to size exceeding %d bytes.", state_->filename_.c_str(), sizeof(buffer)); \
} \
return; \
}