Kyoto Tycoon
|
Update logger. More...
#include <ktulog.h>
Classes | |
class | AutoFlusher |
Automatic flusher of cacheed logs. | |
struct | FileStatus |
Status of each log file. More... | |
struct | Log |
Log message. | |
class | Reader |
Reader of update logs. More... | |
Public Member Functions | |
UpdateLogger () | |
Default constructor. | |
~UpdateLogger () | |
Destructor. | |
bool | open (const std::string &path, int64_t limsiz=-1, double asi=-1) |
Open the logger. | |
bool | close () |
Close the logger. | |
bool | write (const char *mbuf, size_t msiz, uint64_t ts=0) |
Write a log message. | |
bool | write_volatile (char *mbuf, size_t msiz, uint64_t ts=0) |
Write a log message with a volatile buffer. | |
bool | write_bulk (const std::vector< std::string > &mvec, uint64_t ts=0) |
Write multiple log messages at once. | |
uint64_t | clock () |
Get the current clock data for time stamp. | |
void | list_files (std::vector< FileStatus > *fstvec) |
Get status of each log files. | |
Static Public Member Functions | |
static uint64_t | clock_pure () |
Get the current pure clock data for time stamp. |
Update logger.
kyototycoon::UpdateLogger::UpdateLogger | ( | ) | [explicit] |
Default constructor.
Destructor.
bool kyototycoon::UpdateLogger::open | ( | const std::string & | path, |
int64_t | limsiz = -1 , |
||
double | asi = -1 |
||
) |
Open the logger.
path | the path of the base directory. |
limsiz | the limit size of each log file. If it is not more than 0, no limit is specified. If it is kyotocabinet::INT64MIN, the logger is opened as reader. |
asi | the interval of auto synchronization. If it is not more than 0, auto synchronization is not performed. |
bool kyototycoon::UpdateLogger::close | ( | ) |
Close the logger.
bool kyototycoon::UpdateLogger::write | ( | const char * | mbuf, |
size_t | msiz, | ||
uint64_t | ts = 0 |
||
) |
Write a log message.
mbuf | the pointer to the message region. |
msiz | the size of the message region. |
ts | the time stamp of the message. If it is not more than 0, the current time stamp is specified. |
bool kyototycoon::UpdateLogger::write_volatile | ( | char * | mbuf, |
size_t | msiz, | ||
uint64_t | ts = 0 |
||
) |
Write a log message with a volatile buffer.
mbuf | the pointer to the message region which is allocated by the new[] operator. |
msiz | the size of the message region. |
ts | the time stamp of the message. If it is not more than 0, the current time stamp is specified. |
bool kyototycoon::UpdateLogger::write_bulk | ( | const std::vector< std::string > & | mvec, |
uint64_t | ts = 0 |
||
) |
Write multiple log messages at once.
mvec | a string vector of log messages. |
ts | the time stamp of the message. If it is not more than 0, the current time stamp is specified. |
uint64_t kyototycoon::UpdateLogger::clock | ( | ) |
Get the current clock data for time stamp.
void kyototycoon::UpdateLogger::list_files | ( | std::vector< FileStatus > * | fstvec | ) |
Get status of each log files.
fstvec | a vector to store status structures of each log files. |
static uint64_t kyototycoon::UpdateLogger::clock_pure | ( | ) | [static] |
Get the current pure clock data for time stamp.