Leosac  0.8.0
Open Source Access Control
Leosac::Tools::LogEntry Class Reference

A log entry. More...

#include <LogEntry.hpp>

+ Collaboration diagram for Leosac::Tools::LogEntry:

Classes

struct  QueryResult
 Structure holding the result for a retrieve() call. More...
 

Public Member Functions

 LogEntry ()
 

Static Public Member Functions

static QueryResult retrieve (DBPtr database, int page_number, int page_size, bool order_asc)
 

Public Attributes

unsigned long id_
 
boost::posix_time::ptime timestamp_
 
std::string msg_
 
std::string run_id_
 The run_id is generated when Leosac starts, and it is used to identify "runs" (ie if Leosac restarts) in order to better tracks logs. More...
 
uint8_t level_
 
size_t thread_id_
 

Private Attributes

const size_t version_
 

Friends

class odb::access
 

Detailed Description

A log entry.

This class is decorated to be ODB friendly. Object of this type will be stored in a SQL database.

The class also provide an API via static method to retrieve entries from an underlying database.

Definition at line 40 of file LogEntry.hpp.

Constructor & Destructor Documentation

◆ LogEntry()

LogEntry::LogEntry ( )

Definition at line 32 of file LogEntry.cpp.

Member Function Documentation

◆ retrieve()

LogEntry::QueryResult LogEntry::retrieve ( DBPtr  database,
int  page_number,
int  page_size,
bool  order_asc 
)
static

Definition at line 61 of file LogEntry.cpp.

Friends And Related Function Documentation

◆ odb::access

friend class odb::access
friend

Definition at line 85 of file LogEntry.hpp.

Member Data Documentation

◆ id_

unsigned long Leosac::Tools::LogEntry::id_

Definition at line 46 of file LogEntry.hpp.

◆ level_

uint8_t Leosac::Tools::LogEntry::level_

Definition at line 63 of file LogEntry.hpp.

◆ msg_

std::string Leosac::Tools::LogEntry::msg_

Definition at line 52 of file LogEntry.hpp.

◆ run_id_

std::string Leosac::Tools::LogEntry::run_id_

The run_id is generated when Leosac starts, and it is used to identify "runs" (ie if Leosac restarts) in order to better tracks logs.

Definition at line 60 of file LogEntry.hpp.

◆ thread_id_

size_t Leosac::Tools::LogEntry::thread_id_

Definition at line 66 of file LogEntry.hpp.

◆ timestamp_

boost::posix_time::ptime Leosac::Tools::LogEntry::timestamp_

Definition at line 49 of file LogEntry.hpp.

◆ version_

const size_t Leosac::Tools::LogEntry::version_
private

Definition at line 88 of file LogEntry.hpp.


The documentation for this class was generated from the following files: