Public Types | Public Member Functions | Static Public Member Functions | Data Fields

LogObject Class Reference

#include <LogObject.h>

Inherits RefCountObj.

Inherited by TextLogObject.

Collaboration diagram for LogObject:
Collaboration graph
[legend]

Public Types

enum  LogObjectFlags { BINARY = 1, REMOTE_DATA = 2, WRITES_TO_PIPE = 4, LOG_OBJECT_FMT_TIMESTAMP = 8 }

Public Member Functions

 LogObject (const LogFormat *format, const char *log_dir, const char *basename, LogFileFormat file_format, const char *header, Log::RollingEnabledValues rolling_enabled, int flush_threads, int rolling_interval_sec=0, int rolling_offset_hr=0, int rolling_size_mb=0, bool auto_created=false) TS_NONNULL(2)
 LogObject (LogObject &)
virtual ~LogObject ()
void add_filter (LogFilter *filter, bool copy=true)
void set_filter_list (const LogFilterList &list, bool copy=true)
void add_loghost (LogHost *host, bool copy=true)
void set_remote_flag ()
void set_fmt_timestamps ()
int log (LogAccess *lad, const char *text_entry=NULL)
int va_log (LogAccess *lad, const char *fmt, va_list ap)
unsigned roll_files (long time_now=0)
int add_to_flush_queue (LogBuffer *buffer)
size_t preproc_buffers (int idx=-1)
void check_buffer_expiration (long time_now)
void display (FILE *fd=stdout)
void displayAsXML (FILE *fd=stdout, bool extended=false)
const char * get_original_filename () const
const char * get_full_filename () const
const char * get_base_filename () const
off_t get_file_size_bytes ()
uint64_t get_signature () const
int get_rolling_interval () const
void set_log_file_header (const char *header)
void set_rolling_enabled (Log::RollingEnabledValues rolling_enabled)
void set_rolling_interval_sec (int rolling_interval_sec)
void set_rolling_offset_hr (int rolling_offset_hr)
void set_rolling_size_mb (int rolling_size_mb)
bool is_collation_client () const
bool receives_remote_data () const
bool writes_to_pipe () const
bool writes_to_disk ()
unsigned int get_flags () const
void rename (char *new_name)
bool has_alternate_name () const
const char * get_format_string ()
void force_new_buffer ()
bool operator== (LogObject &rhs)
int do_filesystem_checks ()

Static Public Member Functions

static uint64_t compute_signature (LogFormat *format, char *filename, unsigned int flags)

Data Fields

bool m_auto_created
LogFormatm_format
Ptr< LogFilem_logFile
LogFilterList m_filter_list
LogHostList m_host_list

Detailed Description

Definition at line 87 of file LogObject.h.


Member Enumeration Documentation

Enumerator:
BINARY 
REMOTE_DATA 
WRITES_TO_PIPE 
LOG_OBJECT_FMT_TIMESTAMP 

Definition at line 90 of file LogObject.h.


Constructor & Destructor Documentation

LogObject::LogObject ( const LogFormat format,
const char *  log_dir,
const char *  basename,
LogFileFormat  file_format,
const char *  header,
Log::RollingEnabledValues  rolling_enabled,
int  flush_threads,
int  rolling_interval_sec = 0,
int  rolling_offset_hr = 0,
int  rolling_size_mb = 0,
bool  auto_created = false 
)
LogObject::LogObject ( LogObject rhs  ) 
LogObject::~LogObject (  )  [virtual]

Member Function Documentation

void LogObject::add_filter ( LogFilter filter,
bool  copy = true 
)

Definition at line 285 of file LogObject.cc.

References LogFilterList::add(), and m_filter_list.

Referenced by LogObject().

void LogObject::add_loghost ( LogHost host,
bool  copy = true 
)

Definition at line 308 of file LogObject.cc.

References LogHostList::add(), Ptr< T >::clear(), m_host_list, and m_logFile.

Referenced by LogObject().

int LogObject::add_to_flush_queue ( LogBuffer buffer  )  [inline]

Definition at line 124 of file LogObject.h.

References LogBufferManager::add_to_flush_queue().

void LogObject::check_buffer_expiration ( long  time_now  ) 

Definition at line 802 of file LogObject.cc.

References LogBuffer::expiration_time(), and force_new_buffer().

uint64_t LogObject::compute_signature ( LogFormat format,
char *  filename,
unsigned int  flags 
) [static]
void LogObject::display ( FILE *  fd = stdout  ) 
void LogObject::displayAsXML ( FILE *  fd = stdout,
bool  extended = false 
)
int LogObject::do_filesystem_checks (  ) 

Definition at line 814 of file LogObject.cc.

References LogHostList::do_filesystem_checks(), m_host_list, and m_logFile.

void LogObject::force_new_buffer (  )  [inline]

Definition at line 199 of file LogObject.h.

Referenced by check_buffer_expiration(), and LogObjectManager::unmanage_api_object().

const char* LogObject::get_base_filename (  )  const [inline]

Definition at line 156 of file LogObject.h.

Referenced by LogBuffer::LogBuffer(), and LogObjectManager::transfer_objects().

off_t LogObject::get_file_size_bytes (  )  [inline]
unsigned int LogObject::get_flags (  )  const [inline]

Definition at line 191 of file LogObject.h.

const char* LogObject::get_format_string (  )  [inline]

Definition at line 197 of file LogObject.h.

References LogFormat::format_string(), and m_format.

const char* LogObject::get_full_filename (  )  const [inline]

Definition at line 155 of file LogObject.h.

Referenced by display().

const char* LogObject::get_original_filename (  )  const [inline]

Definition at line 154 of file LogObject.h.

int LogObject::get_rolling_interval (  )  const [inline]

Definition at line 162 of file LogObject.h.

uint64_t LogObject::get_signature (  )  const [inline]

Definition at line 160 of file LogObject.h.

Referenced by LogObjectManager::get_object_with_signature(), and operator==().

bool LogObject::has_alternate_name (  )  const [inline]

Definition at line 195 of file LogObject.h.

bool LogObject::is_collation_client (  )  const [inline]

Definition at line 186 of file LogObject.h.

References m_logFile.

Referenced by display(), LogObjectManager::open_local_pipes(), operator==(), and ~LogObject().

int LogObject::log ( LogAccess lad,
const char *  text_entry = NULL 
)
bool LogObject::operator== ( LogObject rhs  )  [inline]
size_t LogObject::preproc_buffers ( int  idx = -1  )  [inline]

Definition at line 133 of file LogObject.h.

References m_host_list, m_logFile, and LogBufferManager::preproc_buffers().

Referenced by ~LogObject().

bool LogObject::receives_remote_data (  )  const [inline]

Definition at line 187 of file LogObject.h.

References REMOTE_DATA.

Referenced by operator==().

void LogObject::rename ( char *  new_name  ) 

Definition at line 272 of file LogObject.cc.

References ats_free(), ats_strdup, and m_logFile.

unsigned LogObject::roll_files ( long  time_now = 0  ) 
void LogObject::set_filter_list ( const LogFilterList list,
bool  copy = true 
)
void LogObject::set_fmt_timestamps (  )  [inline]

Definition at line 117 of file LogObject.h.

Referenced by LogConfig::init(), and TextLogObject::TextLogObject().

void LogObject::set_log_file_header ( const char *  header  )  [inline]

Definition at line 164 of file LogObject.h.

References m_logFile.

void LogObject::set_remote_flag (  )  [inline]

Definition at line 116 of file LogObject.h.

Referenced by Log::match_logobject().

void LogObject::set_rolling_enabled ( Log::RollingEnabledValues  rolling_enabled  )  [inline]

Definition at line 166 of file LogObject.h.

void LogObject::set_rolling_interval_sec ( int  rolling_interval_sec  )  [inline]

Definition at line 171 of file LogObject.h.

void LogObject::set_rolling_offset_hr ( int  rolling_offset_hr  )  [inline]

Definition at line 176 of file LogObject.h.

void LogObject::set_rolling_size_mb ( int  rolling_size_mb  )  [inline]

Definition at line 181 of file LogObject.h.

int LogObject::va_log ( LogAccess lad,
const char *  fmt,
va_list  ap 
)
bool LogObject::writes_to_disk (  )  [inline]

Definition at line 189 of file LogObject.h.

References m_logFile, and WRITES_TO_PIPE.

bool LogObject::writes_to_pipe (  )  const [inline]

Definition at line 188 of file LogObject.h.

References WRITES_TO_PIPE.

Referenced by log(), and LogObjectManager::open_local_pipes().


Field Documentation

Definition at line 207 of file LogObject.h.

Definition at line 210 of file LogObject.h.

Referenced by add_filter(), display(), displayAsXML(), log(), LogObject(), operator==(), and set_filter_list().


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