Created
January 21, 2019 15:04
-
-
Save mudrd8mz/930b8a993789f2a3da77955c3aab48e5 to your computer and use it in GitHub Desktop.
Moodle mtrace modification that makes PID appear in cron logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit xxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
Author: David Mudrák <[email protected]> | |
Date: Mon Jan 21 15:49:09 2019 +0100 | |
Include PID in mtrace console output, e.g. in cron logs | |
diff --git a/lib/moodlelib.php b/lib/moodlelib.php | |
index 18e7a74cef..8d45d8d84c 100644 | |
--- a/lib/moodlelib.php | |
+++ b/lib/moodlelib.php | |
@@ -8949,7 +8949,7 @@ function mtrace($string, $eol="\n", $sleep=0) { | |
$fn($string, $eol); | |
return; | |
} else if (defined('STDOUT') && !PHPUNIT_TEST && !defined('BEHAT_TEST')) { | |
- fwrite(STDOUT, $string.$eol); | |
+ fwrite(STDOUT, '[PID '.(string) getmypid().'] '.$string.$eol); | |
} else { | |
echo $string . $eol; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment