S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_log_buffer Class Reference

The streambuffer used to log messages to a number of registered ostream objects. More...

#include <s3_logger.h>

Inheritance diagram for s3_log_buffer:

Inheritance graph
[legend]
Collaboration diagram for s3_log_buffer:

Collaboration graph
[legend]
List of all members.

Public Methods

 s3_log_buffer (const std::string ident_arg, std::ostream *def_out=0, const bool b_append_info_arg=true)
 Constructor set the default priority level to LOG_ERR. More...

virtual ~s3_log_buffer ()
 Destructor. More...

void set_ident (const std::string &new_ident)
 Change the current ident. More...

int get_priority (void)
 Return the current priority. More...

void set_priority (const int new_priority)
 Set the current priority. More...


Private Methods

virtual void write_to_device ()
 Necessary overload for s3_generi4c_streambuf::write_to_device(). More...


Private Attributes

std::string ident
 The string that is prepended to all messages. More...

int priority
 The current message priority. More...

std::string priority_str
 The string applicable to the current priority setting. More...

s3_mutex write_lock
 Mutex to protect critical write section. More...

bool b_append_info

Detailed Description

The streambuffer used to log messages to a number of registered ostream objects.

Being derived for list<ostream*>, this class is a list of ostream pointers. Messages streamed to here are send to all the ostream objects contained in the list.

Do not use this class direcly, rather use s3_logger.

See also:
The overall operation of the S3 Logging System.
Author:
Francois Swanepoel <swanepoel@stonethree.com>

Definition at line 468 of file s3_logger.h.


Constructor & Destructor Documentation

s3_log_buffer::s3_log_buffer const std::string    ident_arg,
std::ostream *    def_out = 0,
const bool    b_append_info_arg = true
[inline]
 

Constructor set the default priority level to LOG_ERR.

Parameters:
ident_arg  The string that is prepended to all messages.
def_out  The ostream to which this streambuf should stream to. If not supplied, it defaults to cerr. Registered ostream pointers can be altered using standard STL list methods (like clear(), push_back(), etc.).

Definition at line 515 of file s3_logger.h.

References b_append_info, ident, set_ident, and set_priority.

virtual s3_log_buffer::~s3_log_buffer   [inline, virtual]
 

Destructor.

Definition at line 536 of file s3_logger.h.

References s3_generic_streambuf::sync.


Member Function Documentation

int s3_log_buffer::get_priority void    [inline]
 

Return the current priority.

Definition at line 553 of file s3_logger.h.

References priority.

Referenced by s3_logger::getpriority.

void s3_log_buffer::set_ident const std::string &    new_ident [inline]
 

Change the current ident.

Definition at line 542 of file s3_logger.h.

References b_append_info, and ident.

Referenced by s3_log_buffer, and s3_logger::setident.

void s3_log_buffer::set_priority const int    new_priority [inline]
 

Set the current priority.

The following constants are accepted, in order of decreasing importance (an invalid priority value will be ignored):

  • LOG_EMERG - system is unusable
  • LOG_ALERT - action must be taken immediately
  • LOG_CRIT - critical conditions
  • LOG_ERR - error conditions
  • LOG_WARNING - warning conditions
  • LOG_NOTICE - normal, but significant, condition
  • LOG_INFO - informational message
  • LOG_DEBUG - debug-level message

Definition at line 573 of file s3_logger.h.

References b_append_info, priority, and priority_str.

Referenced by s3_log_buffer, and s3_logger::setpriority.

virtual void s3_log_buffer::write_to_device   [inline, private, virtual]
 

Necessary overload for s3_generi4c_streambuf::write_to_device().

Implements s3_generic_streambuf.

Definition at line 487 of file s3_logger.h.

References ident, s3_mutex::lock, priority_str, and s3_mutex::unlock.


Member Data Documentation

bool s3_log_buffer::b_append_info [private]
 

Definition at line 501 of file s3_logger.h.

Referenced by s3_log_buffer, set_ident, and set_priority.

std::string s3_log_buffer::ident [private]
 

The string that is prepended to all messages.

Definition at line 475 of file s3_logger.h.

Referenced by s3_log_buffer, set_ident, and write_to_device.

int s3_log_buffer::priority [private]
 

The current message priority.

Definition at line 478 of file s3_logger.h.

Referenced by get_priority, and set_priority.

std::string s3_log_buffer::priority_str [private]
 

The string applicable to the current priority setting.

Definition at line 481 of file s3_logger.h.

Referenced by set_priority, and write_to_device.

s3_mutex s3_log_buffer::write_lock [private]
 

Mutex to protect critical write section.

Definition at line 484 of file s3_logger.h.


The documentation for this class was generated from the following file:
Send comments to: s3fc@stonethree.com SourceForge Logo