mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-60671 core_search: Cron output should use mtrace
The mtrace function is preferable for plain text logging/progress output because it can be redirected if necessary. By convention it is normally used in cron and can be used in CLI tasks if required. This change makes the text_progress_trace class use mtrace instead of echo and then flush. (Default behaviour of mtrace is to do exactly that, but it can be redirected too.) Before this change, if anybody is relying on mtrace behaviour to redirect logs of cron output, this will fail for some parts of the search cron output (and some other places like auth plugins).
This commit is contained in:
parent
c8e7777766
commit
11e60032be
@ -3253,8 +3253,7 @@ class text_progress_trace extends progress_trace {
|
||||
* @return void Output is echo'd
|
||||
*/
|
||||
public function output($message, $depth = 0) {
|
||||
echo str_repeat(' ', $depth), $message, "\n";
|
||||
flush();
|
||||
mtrace(str_repeat(' ', $depth) . $message);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user