mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Add logging for maint mode config
This commit is contained in:
@@ -246,6 +246,7 @@ class outagelib {
|
||||
unset_config('maintenance_message');
|
||||
}
|
||||
set_config('maintenance_later', $outage->starttime);
|
||||
self::maintenance_config_log($outage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,4 +415,21 @@ EOT;
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging for maintenance mode configuration.
|
||||
*
|
||||
* @param outage|null $outage Outage or null if no scheduled outage.
|
||||
*/
|
||||
private static function maintenance_config_log(outage $outage) {
|
||||
// Not output logging info in php unit test.
|
||||
if (PHPUNIT_TEST) return;
|
||||
|
||||
mtrace(get_string('logformaintmodeconfig', 'auth_outage'));
|
||||
$timezone = ' (Timezone ' . \core_date::get_server_timezone_object()->getName() . ')';
|
||||
mtrace('... updated at ' . date('H:i:s'));
|
||||
$time = date("Y-m-d H:i:s", $outage->starttime);
|
||||
mtrace("... enable maintenance mode at $time $timezone");
|
||||
mtrace(get_string('logformaintmodeconfigcomplete', 'auth_outage'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user