libassa 3.5.1
Loading...
Searching...
No Matches
Functions
ASSA::Log Namespace Reference

Functions

void set_app_name (const std::string &appname_)
 Set application name.
 
int open_log_file (const char *logfname_, u_long groups_=ALL, u_long maxsize_=10485760)
 Open log file.
 
int open_log_stdout (u_long groups_=ALL)
 Write log message to standard output.
 
int open_log_server (const std::string &logsvraddr_, const char *logfname_, Reactor *reactor_, u_long groups_=ASSA::ALL, u_long maxsize_=10485760)
 Open connection with and write log message to the log server.
 
void log_resync (void)
 Resynchronize logging stream after Fork.
 
int log_close (void)
 Close logging stream.
 
void set_gmt_timezone (void)
 Set timezone to GMT.
 
void enable_timestamp (void)
 Enable timestamp logging.
 
void disable_timestamp (void)
 Disable timestamp logging.
 

Function Documentation

◆ disable_timestamp()

void ASSA::Log::disable_timestamp ( void  )
inline

Disable timestamp logging.

Definition at line 368 of file Logger.h.

368{ LOGGER->disable_timestamp (); }
#define LOGGER
A shortcut to locate a singleton object of class Logger.
Definition Logger.h:136

References LOGGER.

◆ enable_timestamp()

void ASSA::Log::enable_timestamp ( void  )
inline

Enable timestamp logging.

Definition at line 365 of file Logger.h.

365{ LOGGER->enable_timestamp (); }

References LOGGER.

◆ log_close()

int ASSA::Log::log_close ( void  )
inline

Close logging stream.

Definition at line 359 of file Logger.h.

359{ return LOGGER->log_close (); }

References LOGGER.

Referenced by ASSA::GenServer::~GenServer().

◆ log_resync()

void ASSA::Log::log_resync ( void  )
inline

Resynchronize logging stream after Fork.

Definition at line 356 of file Logger.h.

356{ LOGGER->log_resync (); }

References LOGGER.

◆ open_log_file()

int ASSA::Log::open_log_file ( const char logfname_,
u_long  groups_ = ALL,
u_long  maxsize_ = 10485760 
)
inline

Open log file.

Parameters
logfname_File name
groups_ORed bitmask of logging groups as defined in assa/LogMask.h. Default is to log all groups.
maxsize_Maximum size log file can reach before renamed to logfilename_0. Default is 10 megabytes.

Definition at line 319 of file Logger.h.

322 {
323 return LOGGER->log_open (logfname_, groups_, maxsize_);
324 }
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32

References LOGGER.

Referenced by ASSA::GenServer::init_internals().

◆ open_log_server()

int ASSA::Log::open_log_server ( const std::string &  logsvraddr_,
const char logfname_,
Reactor reactor_,
u_long  groups_ = ASSA::ALL,
u_long  maxsize_ = 10485760 
)
inline

Open connection with and write log message to the log server.

Parameters
logsvraddr_Address of the logserver, assa-logd in the form port@host
logfname_Log file path
reactor_Reactor to use for communications.
groups_ORed bitmask of logging groups as defined in LogMask.h. Default is to log all groups.
maxsize_Maximum size log file can reach before renamed to logfilename_0. Default is 10Mb.

Definition at line 344 of file Logger.h.

349 {
350 int ret = LOGGER->log_open (logsvraddr_, logfname_, groups_,
352 return ret;
353 }

References LOGGER.

Referenced by ASSA::GenServer::init_internals().

◆ open_log_stdout()

int ASSA::Log::open_log_stdout ( u_long  groups_ = ALL)
inline

Write log message to standard output.

Definition at line 327 of file Logger.h.

328 {
329 return LOGGER->log_open (groups_);
330 }

References LOGGER.

Referenced by ASSA::GenServer::init_internals().

◆ set_app_name()

void ASSA::Log::set_app_name ( const std::string &  appname_)
inline

Set application name.

Call this function before any other to have application name set properly. This is especially important if you plan to call open_log_server() to send messages to the log server, assa-logd.

Definition at line 305 of file Logger.h.

306 {
307 LOGGER->set_app_name (appname_);
308 }

References LOGGER.

Referenced by ASSA::GenServer::init_internals().

◆ set_gmt_timezone()

void ASSA::Log::set_gmt_timezone ( void  )
inline

Set timezone to GMT.

Definition at line 362 of file Logger.h.

362{ LOGGER->set_timezone (0); }

References LOGGER.