|
DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <msghandler.hpp>
Public Types | |
| typedef UI::t_str | t_str |
| typedef std::vector< t_str > | t_levels |
Public Member Functions | |
| void | set (t_str const &logfile) |
| void | setlevel (t_str const &level, t_levels levels) |
| void | message (t_str const &messagein) |
| void | message (t_str const &msglevel, t_str const &messagein) |
Static Public Member Functions | |
| static msghandler & | ref () |
Private Types | |
| typedef B | t_bool |
| typedef T | t_thread |
| typedef M | t_mut |
| typedef std::lock_guard< t_mut > | t_lock |
| typedef std::shared_ptr< t_str > | t_str_ptr |
| typedef std::ofstream | t_file |
| typedef std::unique_ptr< t_file > | t_file_ptr |
| template<typename E > | |
| using | t_container = std::queue<E> |
| typedef t_container< std::pair< t_str, t_str > > | t_messages |
Private Member Functions | |
| void | on () |
| void | handle () |
| template<typename TR = UI> | |
| TR::default_post_ret_type | post (t_str const &m, t_str const &l) |
| template<typename TR = UI> | |
| TR::post_ret_type | post (t_str const &m, t_str const &l) |
| void | file (t_str const &) |
| bool | levelcheck (t_str const &level) const |
| void | reopen (t_str const &) |
| ~msghandler () | |
| msghandler () | |
| msghandler (msghandler const &)=delete | |
| msghandler & | operator= (msghandler const &)=delete |
Private Attributes | |
| t_messages | m_messages |
| t_levels | m_levels |
| t_str | m_level |
| std::condition_variable | m_condition |
| std::mutex | m_cond_lock |
| t_str_ptr | m_logfile |
| t_file_ptr | m_file |
| t_thread * | m_handler |
| t_bool | m_running |
| t_bool | m_have_messages |
| t_mut | m_loock |
Class providing message handling capabilities to multiple sources
Definition at line 37 of file msghandler.hpp.
|
private |
Definition at line 84 of file msghandler.hpp.
|
private |
Definition at line 94 of file msghandler.hpp.
|
private |
Definition at line 91 of file msghandler.hpp.
|
private |
Definition at line 92 of file msghandler.hpp.
| std::vector<t_str> lutils::program::msghandler< UI, M, T, B >::t_levels |
Definition at line 41 of file msghandler.hpp.
|
private |
Definition at line 88 of file msghandler.hpp.
|
private |
Definition at line 95 of file msghandler.hpp.
|
private |
Definition at line 87 of file msghandler.hpp.
| UI::t_str lutils::program::msghandler< UI, M, T, B >::t_str |
Definition at line 40 of file msghandler.hpp.
|
private |
Definition at line 89 of file msghandler.hpp.
|
private |
Definition at line 86 of file msghandler.hpp.
|
inlineprivate |
Destruction waits to write all messages to file
Definition at line 29 of file msghandler.hxx.
|
inlineprivate |
|
privatedelete |
|
inlineprivate |
Send message to file
| the | filename to write to |
Default write to file function
This should not be specialized
| m |
Definition at line 217 of file msghandler.hxx.
|
inlineprivate |
Handles incoming messages
Checks the queue and redirects messages either to a defined output or to a file if a file has been set
Definition at line 99 of file msghandler.hxx.
|
inlineprivate |
Checks the level of a message and return true if the level of the message is appropriate to be displayed
| level | of a message |
Definition at line 190 of file msghandler.hxx.
|
inline |
Add a message to the queue to be served
| a | string as a message |
Adds the message in the internal container which will be picked up later
| messagein | is the message to be displayed |
Definition at line 140 of file msghandler.hxx.
|
inline |
Add a message to the queue to be served
| messagein | is the message content to be displayed |
| msglevel | is a tag representing the level of the message |
Definition at line 146 of file msghandler.hxx.
|
inlineprivate |
Sets the object in ready to process state
Properly starts the message handler
Definition at line 81 of file msghandler.hxx.
|
privatedelete |
|
inlineprivate |
Sends message to standard output or the provided UI::post method
| m | is the message to send |
Default post action for users classes that define default_post_ret_type
| m | the message to display |
Definition at line 162 of file msghandler.hxx.
|
inlineprivate |
Post action for users classes that define post_ret_type. These have to also define the post function
| m | the message to display |
Definition at line 176 of file msghandler.hxx.
|
inlinestatic |
Creates or retrieves the msghandler
Creates the message handler
Definition at line 254 of file msghandler.hxx.
|
inlineprivate |
Opens a designated file
| the | filename to open |
Closes the current logfile and opens a new one
| logfile |
Definition at line 228 of file msghandler.hxx.
|
inline |
Sets the logfile. All remaining messages will be appended to that file
| logfile |
Properly sets the logfile
| logfile | to write to |
Definition at line 72 of file msghandler.hxx.
|
inline |
Sets the minimum level of messages that the message handler will consider for handling. The rest will be discarded
| level | is a string that defines the minimum level |
| levels | is a vector of strings in order of imporance |
Sets the minimum level of messages that the message handler will consider for handling. The rest will be discarded
| level | is a string that defines the minimum level |
| levels | is a vector of strings in order of importance (least important -> most ) |
Definition at line 60 of file msghandler.hxx.
|
private |
Definition at line 102 of file msghandler.hpp.
|
private |
Definition at line 101 of file msghandler.hpp.
|
private |
Definition at line 106 of file msghandler.hpp.
|
private |
Definition at line 108 of file msghandler.hpp.
|
private |
Definition at line 111 of file msghandler.hpp.
|
private |
Definition at line 99 of file msghandler.hpp.
|
private |
Definition at line 98 of file msghandler.hpp.
|
private |
Definition at line 105 of file msghandler.hpp.
|
private |
Definition at line 113 of file msghandler.hpp.
|
private |
Definition at line 97 of file msghandler.hpp.
|
private |
Definition at line 110 of file msghandler.hpp.