From 2def494741ec7bf3543ad0dec9dfd086fceb5da6 Mon Sep 17 00:00:00 2001 From: gravel Date: Fri, 19 May 2023 17:35:44 +0200 Subject: [PATCH] Allow logging null --- php/utils/logging.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/php/utils/logging.php b/php/utils/logging.php index 039705e..7a5798b 100644 --- a/php/utils/logging.php +++ b/php/utils/logging.php @@ -113,7 +113,7 @@ ); } - function _log_message(string $msg, int $message_verbosity) { + function _log_message(?string $msg, int $message_verbosity) { global $LOGGING_VERBOSITY; if ($message_verbosity > $LOGGING_VERBOSITY) return; $runtime = runtime_str(); @@ -129,7 +129,7 @@ * Only logs when `$LOGGING_VERBOSITY` is Error and below. * @param string $msg String message to log. */ - function log_error(string $msg) { + function log_error(?string $msg) { _log_message($msg, LoggingVerbosity::Error); } @@ -138,7 +138,7 @@ * Only logs when `$LOGGING_VERBOSITY` is Warning and below. * @param string $msg String message to log. */ - function log_warning(string $msg) { + function log_warning(?string $msg) { _log_message($msg, LoggingVerbosity::Warning); } @@ -147,7 +147,7 @@ * Only logs when `$LOGGING_VERBOSITY` is Info and below. * @param string $msg String message to log. */ - function log_info(string $msg) { + function log_info(?string $msg) { _log_message($msg, LoggingVerbosity::Info); } @@ -156,7 +156,7 @@ * Only logs when `$LOGGING_VERBOSITY` is Debug and below. * @param string $msg String message to log. */ - function log_debug(string $msg) { + function log_debug(?string $msg) { _log_message($msg, LoggingVerbosity::Debug); }