NEST main@caf0ae8
 
Loading...
Searching...
No Matches
logging_manager.h
Go to the documentation of this file.
1/*
2 * logging_manager.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef LOGGING_MANAGER_H
24#define LOGGING_MANAGER_H
25
26// C++ includes:
27#include <string>
28#include <vector>
29
30// Includes from libnestutil:
31#include "dictionary.h"
32#include "logging.h"
33#include "manager_interface.h"
34
35
36// Inclused from nestkernel:
37#include "nest_names.h"
38
39namespace nest
40{
41
42class LoggingEvent;
43
45{
46public:
48 ~LoggingManager() override;
49
50 void initialize( const bool ) override;
51 void finalize( const bool ) override;
52 void set_status( const Dictionary& ) override;
53 void get_status( Dictionary& ) override;
54
62
73 void
74 publish_log( const VerbosityLevel, const std::string&, const std::string&, const std::string&, const size_t ) const;
75
81 bool dict_miss_is_error() const;
82
84
85private:
92 void deliver_logging_event_( const LoggingEvent& event ) const;
93
94 void default_logging_callback_( const LoggingEvent& event ) const;
95
96private:
97 std::vector< deliver_logging_event_ptr > client_callbacks_;
100};
101
102inline bool
107
108inline VerbosityLevel
110{
111 return logging_level_;
112}
113
114} // namespace nest
115
116#endif /* ifndef LOGGING_MANAGER_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Definition logging_event.h:38
Definition logging_manager.h:45
void register_logging_client(const deliver_logging_event_ptr callback)
Register a logging client.
Definition logging_manager.cpp:79
bool dict_miss_is_error() const
Return true if missing access to dictionary should be considered an error.
Definition logging_manager.h:103
LoggingManager()
Definition logging_manager.cpp:38
void initialize(const bool) override
Prepare manager for operation.
Definition logging_manager.cpp:50
void set_status(const Dictionary &) override
Set the status of the manager.
Definition logging_manager.cpp:64
VerbosityLevel verbosity() const
Definition logging_manager.h:109
~LoggingManager() override
Definition logging_manager.cpp:45
void deliver_logging_event_(const LoggingEvent &event) const
Delivers a LoggingEvent to all registered clients.
Definition logging_manager.cpp:87
bool dict_miss_is_error_
whether to throw exception on missed dictionary entries
Definition logging_manager.h:99
void finalize(const bool) override
Take down manager after operation.
Definition logging_manager.cpp:59
void publish_log(const VerbosityLevel, const std::string &, const std::string &, const std::string &, const size_t) const
Create a LoggingEvent.
Definition logging_manager.cpp:117
std::vector< deliver_logging_event_ptr > client_callbacks_
Definition logging_manager.h:97
VerbosityLevel logging_level_
Definition logging_manager.h:98
void default_logging_callback_(const LoggingEvent &event) const
Definition logging_manager.cpp:100
void get_status(Dictionary &) override
Retrieve the status of the manager.
Definition logging_manager.cpp:71
Interface for kernel manager classes.
Definition manager_interface.h:46
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void(* deliver_logging_event_ptr)(const LoggingEvent &e)
Definition logging.h:53
VerbosityLevel
Report only messages at levels higher than chosen level to user or logs. Default INFO.
Definition logging.h:40