Allow logging null

parallel-fetching
gravel 2 years ago
parent f55e416d53
commit 2def494741
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -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);
}

Loading…
Cancel
Save