Skip to content

Commit

Permalink
Logger: Make the logger more const friendly.
Browse files Browse the repository at this point in the history
This change fixes no issues but it does enable the fixing of several
issues and should eliminate issues going forward.

Signed-off-by: Charlie Vigue <[email protected]>
  • Loading branch information
cvigue committed Oct 3, 2024
1 parent c42bea7 commit 1fb9457
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions openvpn/log/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Logger
* @param msg the message to print
*/
template <int LEVEL, typename T>
void log(T &&msg)
void log(T &&msg) const
{
/* this ensures that the function is empty if MAX_LEVEL excludes this level */
if constexpr (max_log_level >= LEVEL)
Expand All @@ -103,7 +103,7 @@ class Logger
* @param msg the message to print
*/
template <typename T>
void log_trace(T &&msg)
void log_trace(T &&msg) const
{
log<LOG_LEVEL_TRACE>(std::forward<T>(msg));
}
Expand All @@ -114,7 +114,7 @@ class Logger
* @param msg the message to print
*/
template <typename T>
void log_debug(T &&msg)
void log_debug(T &&msg) const
{
log<LOG_LEVEL_DEBUG>(std::forward<T>(msg));
}
Expand All @@ -125,7 +125,7 @@ class Logger
* @param msg the message to print
*/
template <typename T>
void log_info(T &&msg)
void log_info(T &&msg) const
{
log<LOG_LEVEL_INFO>(std::forward<T>(msg));
}
Expand All @@ -135,7 +135,7 @@ class Logger
* @param msg the message to log
*/
template <typename T>
void log_verbose(T &&msg)
void log_verbose(T &&msg) const
{
log<LOG_LEVEL_VERB>(std::forward<T>(msg));
}
Expand All @@ -145,7 +145,7 @@ class Logger
* @param msg the message to log
*/
template <typename T>
void log_error(T &&msg)
void log_error(T &&msg) const
{
log<LOG_LEVEL_ERROR>(std::forward<T>(msg));
}
Expand Down

0 comments on commit 1fb9457

Please sign in to comment.