Skip to content

Commit

Permalink
Improve logging.hpp, add explicit for auto_logger_file__ class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Aug 3, 2024
1 parent fd4eba5 commit 1483b81
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions proxy/include/proxy/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ class auto_logger_file__
auto_logger_file__& operator=(const auto_logger_file__&) = delete;

public:
auto_logger_file__(std::string log_path = "")
explicit auto_logger_file__(std::string log_path = "")
{
if (!log_path.empty())
m_log_path = log_path;
Expand Down Expand Up @@ -1819,14 +1819,16 @@ class empty_logger___
defined(ENABLE_LOGGER)) && !defined(DISABLE_LOGGER)

// API for logging.
inline void init_logging(const std::string& path = "");
inline std::string log_path();
inline std::string log_path();
inline void shutdown_logging();
inline void turnoff_logging() noexcept;
inline void turnon_logging() noexcept;
inline void toggle_write_logging(bool disable);
inline void set_logfile_maxsize(int64_t size) noexcept;
namespace xlogger {
inline void init_logging(const std::string& path/* = ""*/);
inline std::string log_path();
inline std::string log_path();
inline void shutdown_logging();
inline void turnoff_logging() noexcept;
inline void turnon_logging() noexcept;
inline void toggle_write_logging(bool disable);
inline void set_logfile_maxsize(int64_t size) noexcept;
}

// API for logging.
#define XLOG_DBG xlogger::logger___(xlogger::_logger_debug_id__)
Expand Down

0 comments on commit 1483b81

Please sign in to comment.