Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
log4cpp::PropertyConfiguratorImpl Class Reference

#include <PropertyConfiguratorImpl.hh>

List of all members.

Public Types

typedef std::map< std::string,
Appender * > 
AppenderMap

Public Member Functions

virtual void doConfigure (const std::string &initFileName) throw (ConfigureFailure)
virtual void doConfigure (std::istream &in) throw (ConfigureFailure)
 PropertyConfiguratorImpl ()
virtual ~PropertyConfiguratorImpl ()

Protected Member Functions

void configureCategory (const std::string &categoryname) throw (ConfigureFailure)
void getCategories (std::vector< std::string > &categories) const
void instantiateAllAppenders () throw (ConfigureFailure)
AppenderinstantiateAppender (const std::string &name)
void setLayout (Appender *appender, const std::string &name)

Protected Attributes

AppenderMap _allAppenders
Properties _properties

Detailed Description

Definition at line 25 of file PropertyConfiguratorImpl.hh.


Member Typedef Documentation

Definition at line 27 of file PropertyConfiguratorImpl.hh.


Constructor & Destructor Documentation

Definition at line 60 of file PropertyConfiguratorImpl.cpp.

Definition at line 63 of file PropertyConfiguratorImpl.cpp.


Member Function Documentation

void log4cpp::PropertyConfiguratorImpl::configureCategory ( const std::string &  categoryname) throw (ConfigureFailure) [protected]

configure the given category. This includes setting its Priority and adding any Appenders.

Todo:
setting other properties like 'additivity'.
Parameters:
categorynameName of the category to configure. The name 'rootCategory' refers to the root Category. throw ConfigureFailure

Definition at line 132 of file PropertyConfiguratorImpl.cpp.

void log4cpp::PropertyConfiguratorImpl::doConfigure ( const std::string &  initFileName) throw (ConfigureFailure) [virtual]

Definition at line 66 of file PropertyConfiguratorImpl.cpp.

void log4cpp::PropertyConfiguratorImpl::doConfigure ( std::istream &  in) throw (ConfigureFailure) [virtual]

Definition at line 77 of file PropertyConfiguratorImpl.cpp.

void log4cpp::PropertyConfiguratorImpl::getCategories ( std::vector< std::string > &  categories) const [protected]

Get a list of categories for which we should do the configuration. This simply extracts the categories from the map.

Parameters:
categoriesReference to a list which is to receive the list of categories.

Get the categories contained within the map of properties. Since the category looks something like "category.xxxxx.yyy.zzz", we need to search the entire map to figure out which properties are category listings. Seems like there might be a more elegant solution.

Definition at line 334 of file PropertyConfiguratorImpl.cpp.

Definition at line 93 of file PropertyConfiguratorImpl.cpp.

Appender * log4cpp::PropertyConfiguratorImpl::instantiateAppender ( const std::string &  name) [protected]

Intantiate and configure the appender referred to by the given name. This method searches the map to find all configuration parameters for the appender, and adds the appender to the given category. This isn't very general in the sense that it will need to be modified for each type of appender and layout. A more general solution would be to define an "options" interface for each appender and layout, so that we can simply call this method with a list of options instead of needing to know what is or is not available. This would also require some generic way of instantiating an object for which we have no knowledge. An "AppenderFactory" could be used which maps the given type to an actual object class registered with the factory (?? is this possible?).

Parameters:
nameString containing the name of the type of appender to be instantiated.

Definition at line 188 of file PropertyConfiguratorImpl.cpp.

void log4cpp::PropertyConfiguratorImpl::setLayout ( Appender appender,
const std::string &  name 
) [protected]

Method for instantiating and configuring the layouts associated with each appender.

Parameters:
appenderAppender to which we are setting this layout.
nameName in the properties of this appender.

Definition at line 284 of file PropertyConfiguratorImpl.cpp.


Member Data Documentation

Definition at line 80 of file PropertyConfiguratorImpl.hh.

Definition at line 79 of file PropertyConfiguratorImpl.hh.


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


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Aug 14 2016 03:18:26