#include <Logger.hpp>
Public Member Functions | |
| void | set_level (Level level) |
| void | set_utc (bool enabled) |
| void | set_microseconds (bool enabled) |
| void | set_log_file (const std::string &path) |
| void | debug (const std::string &msg) |
| void | info (const std::string &msg) |
| void | warning (const std::string &msg) |
| void | error (const std::string &msg) |
Static Public Member Functions | |
| static Logger & | instance () |
Private Member Functions | |
| void | log (Level level, const std::string &msg) |
| std::string | timestamp () const |
| std::string | level_name (Level level) const |
Private Attributes | |
| Level | level_ {Level::Info} |
| bool | utc_ {true} |
| bool | micro_ {false} |
| std::string | file_path_ |
| std::mutex | mutex_ |
Definition at line 9 of file Logger.hpp.
| void bsc::logging::Logger::debug | ( | const std::string & | msg | ) |
| void bsc::logging::Logger::error | ( | const std::string & | msg | ) |
| void bsc::logging::Logger::info | ( | const std::string & | msg | ) |
Definition at line 21 of file Logger.cpp.
References bsc::logging::Info, and log().
Referenced by bsc::fw::Firewall::install_nfqueue_rule(), bsc::fw::Firewall::reload(), bsc::fw::anonymous_namespace{Firewall.cpp}::render_json_config_to_nft(), bsc::service::DaemonService::scan_connections(), and bsc::ebpf::EBPFMon::start().
|
static |
Definition at line 11 of file Logger.cpp.
Referenced by bsc::service::DaemonService::decide_connection(), bsc::ui::UIClient::Impl::dispatch_incoming(), bsc::service::DaemonService::handle_notification(), bsc::service::DaemonService::handle_proc_event(), bsc::fw::Firewall::install_nfqueue_rule(), main(), bsc::ui::UIClient::Impl::read_until_eof(), bsc::ui::UIClient::Impl::reconnect_loop(), bsc::fw::Firewall::reload(), bsc::service::DaemonService::reload_firewall(), bsc::fw::anonymous_namespace{Firewall.cpp}::render_json_config_to_nft(), bsc::service::DaemonService::run(), bsc::service::DaemonService::scan_connections(), bsc::service::DaemonService::set_desktop_active(), and bsc::ebpf::EBPFMon::start().
|
private |
Definition at line 52 of file Logger.cpp.
References bsc::logging::Debug, bsc::logging::Error, bsc::logging::Info, and bsc::logging::Warning.
Referenced by log().
|
private |
Definition at line 25 of file Logger.cpp.
References file_path_, level_, level_name(), mutex_, and timestamp().
| void bsc::logging::Logger::set_level | ( | Level | level | ) |
Definition at line 16 of file Logger.cpp.
References level_.
Referenced by bsc::service::DaemonService::handle_notification().
| void bsc::logging::Logger::set_log_file | ( | const std::string & | path | ) |
| void bsc::logging::Logger::set_microseconds | ( | bool | enabled | ) |
Definition at line 18 of file Logger.cpp.
References micro_.
Referenced by bsc::service::DaemonService::handle_notification().
| void bsc::logging::Logger::set_utc | ( | bool | enabled | ) |
Definition at line 17 of file Logger.cpp.
References utc_.
Referenced by bsc::service::DaemonService::handle_notification().
|
private |
Definition at line 37 of file Logger.cpp.
Referenced by log().
| void bsc::logging::Logger::warning | ( | const std::string & | msg | ) |
Definition at line 22 of file Logger.cpp.
References log(), and bsc::logging::Warning.
Referenced by bsc::ui::UIClient::Impl::dispatch_incoming(), bsc::fw::Firewall::install_nfqueue_rule(), bsc::fw::Firewall::reload(), and bsc::service::DaemonService::reload_firewall().
|
private |
Definition at line 29 of file Logger.hpp.
Referenced by log(), and set_log_file().
|
private |
Definition at line 26 of file Logger.hpp.
Referenced by log(), and set_level().
|
private |
Definition at line 28 of file Logger.hpp.
Referenced by set_microseconds(), and timestamp().
|
mutableprivate |
Definition at line 30 of file Logger.hpp.
Referenced by log().
|
private |
Definition at line 27 of file Logger.hpp.
Referenced by set_utc(), and timestamp().