Hi everyone,
Will it have sense to use general `log` method instead of calling method from variable? Less code + Less magic in the code = Easier to read.
I also think that from logs searching perspective logs should be placed in the old channel and not in a new one. If log comes from a module it should be written into the modules channel and not into a new one.
// A severity of -1 is not a valid RfcLogLevel but is the default value. With -1,
// Ultimate Cron logs a message saying that cron has been executed, which is
// unnecessary if you're running cron every minute as recommended.
if ($log_entry->severity > -1) {
$log_message = strip_tags($log_entry->message ?: $log_entry->formatInitMessage());
$this
->loggerFactory
->get($log_entry->name)
->log($log_entry->severity, $log_message);
}
I have added strip_tags in my example to convert such error messages:
LogicException: Tratata in super_duper_cron() (line 44 of
To this:
LogicException: Tratata in super_duper_cron() (line 44 of /var/www/html/web/modules/custom/my_module/my_module.module).
Rebased MR on latest 8.x-3.x.
Could not update MR, so will add patch here.
This patch can solve the problem until someone will create better solution.
devdits β made their first commit to this issueβs fork.