NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::LoggingManager Class Reference

#include <logging_manager.h>

Inheritance diagram for nest::LoggingManager:
[legend]
Collaboration diagram for nest::LoggingManager:
[legend]

Public Member Functions

 LoggingManager ()
 
 ~LoggingManager () override
 
void initialize (const bool) override
 Prepare manager for operation.
 
void finalize (const bool) override
 Take down manager after operation.
 
void set_status (const Dictionary &) override
 Set the status of the manager.
 
void get_status (Dictionary &) override
 Retrieve the status of the manager.
 
void register_logging_client (const deliver_logging_event_ptr callback)
 Register a logging client.
 
void publish_log (const VerbosityLevel, const std::string &, const std::string &, const std::string &, const size_t) const
 Create a LoggingEvent.
 
bool dict_miss_is_error () const
 Return true if missing access to dictionary should be considered an error.
 
VerbosityLevel verbosity () const
 
- Public Member Functions inherited from nest::ManagerInterface
 ManagerInterface (ManagerInterface const &)=delete
 
void operator= (ManagerInterface const &)=delete
 
 ManagerInterface ()
 
virtual ~ManagerInterface ()
 
virtual void prepare ()
 
virtual void cleanup ()
 

Private Member Functions

void deliver_logging_event_ (const LoggingEvent &event) const
 Delivers a LoggingEvent to all registered clients.
 
void default_logging_callback_ (const LoggingEvent &event) const
 

Private Attributes

std::vector< deliver_logging_event_ptr > client_callbacks_
 
VerbosityLevel logging_level_
 
bool dict_miss_is_error_
 whether to throw exception on missed dictionary entries
 

Constructor & Destructor Documentation

◆ LoggingManager()

nest::LoggingManager::LoggingManager ( )

◆ ~LoggingManager()

nest::LoggingManager::~LoggingManager ( )
override

Member Function Documentation

◆ default_logging_callback_()

void nest::LoggingManager::default_logging_callback_ ( const LoggingEvent &  event) const
private

References nest::LoggingEvent::severity, and nest::WARNING.

Referenced by deliver_logging_event_().

Here is the caller graph for this function:

◆ deliver_logging_event_()

void nest::LoggingManager::deliver_logging_event_ ( const LoggingEvent &  event) const
private

Delivers a LoggingEvent to all registered clients.

It iterates all callback from the client_callbacks_ and calls it with the LoggingEvent as argument.

References client_callbacks_, and default_logging_callback_().

Referenced by publish_log().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dict_miss_is_error()

bool nest::LoggingManager::dict_miss_is_error ( ) const
inline

Return true if missing access to dictionary should be considered an error.

Note
Located here for historic reasons.

References dict_miss_is_error_.

◆ finalize()

void nest::LoggingManager::finalize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Take down manager after operation.

After this method has completed, all dynamic data structures created by the manager shall be deallocated and containers emptied. Plain variables need not be reset.

Note
Finalization of any given manager may depend on other managers not having been finalized yet. KernelManager::finalize() is responsible for calling the initialization routines on the specific managers in correct order, i.e., the opposite order of initialize() calls.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment.
See also
initialize()

Implements nest::ManagerInterface.

◆ get_status()

void nest::LoggingManager::get_status ( Dictionary &  )
overridevirtual

Retrieve the status of the manager.

Note
This would ideally be a const function. However, some managers delay the update of internal variables up to the point where they are needed (e.g., before reporting their values to the user, or before simulate is called). An example for this pattern is the call to update_delay_extrema_() right at the beginning of ConnectionManager::get_status().
See also
set_status()

Implements nest::ManagerInterface.

References nest::names::dict_miss_is_error(), dict_miss_is_error_, logging_level_, and nest::names::verbosity().

Here is the call graph for this function:

◆ initialize()

void nest::LoggingManager::initialize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Prepare manager for operation.

After this method has completed, the manager should be completely initialized and "ready for action".

Note
Initialization of any given manager may depend on other managers having been initialized before. KernelManager::initialize() is responsible for calling the initialization routines on the specific managers in correct order.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() or RandomManager::get_status() to limit operations to those necessary for thread adjustment or switch or re-seeding of RNG.
See also
finalize()

Implements nest::ManagerInterface.

References dict_miss_is_error_.

◆ publish_log()

void nest::LoggingManager::publish_log ( const VerbosityLevel  s,
const std::string &  fctn,
const std::string &  msg,
const std::string &  file,
const size_t  line 
) const

Create a LoggingEvent.

This function creates a LoggingEvent that will be delivered to all registered logging clients, if the severity is above the set logging level. Do not use this function to do actual logging in the source code, instead use the LOG() function provided by the logging.h header in libnestutil.

References deliver_logging_event_(), and logging_level_.

Referenced by nest::message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_logging_client()

void nest::LoggingManager::register_logging_client ( const deliver_logging_event_ptr  callback)

Register a logging client.

Register a callback function that will receive all subsequent LoggingEvents. For the method signature see logging.h .

References client_callbacks_.

Referenced by nest::register_logger_client().

Here is the caller graph for this function:

◆ set_status()

void nest::LoggingManager::set_status ( const Dictionary &  )
overridevirtual

Set the status of the manager.

See also
get_status()

Implements nest::ManagerInterface.

References nest::names::dict_miss_is_error(), dict_miss_is_error_, logging_level_, Dictionary::update_value(), and nest::names::verbosity().

Here is the call graph for this function:

◆ verbosity()

VerbosityLevel nest::LoggingManager::verbosity ( ) const
inline

References logging_level_.

Referenced by nest::LoggingEvent::nest_verbosity_level().

Here is the caller graph for this function:

Member Data Documentation

◆ client_callbacks_

std::vector< deliver_logging_event_ptr > nest::LoggingManager::client_callbacks_
private

◆ dict_miss_is_error_

bool nest::LoggingManager::dict_miss_is_error_
private

whether to throw exception on missed dictionary entries

Referenced by dict_miss_is_error(), get_status(), initialize(), and set_status().

◆ logging_level_

VerbosityLevel nest::LoggingManager::logging_level_
private

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