Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ob_logstdout($chunk, $phase) {
- $msec = substr(explode(' ', microtime())[0], 2, 4);
- $return_chunk = '';
- if(substr($chunk, -1) == "\n") {
- $chunk = substr($chunk, 0, -1);
- }
- $lines = explode("\n", $chunk);
- foreach($lines as $line) {
- $line = date('[m-d-y h:i:s.') . $msec . date(' A] ') . $line . "\n";
- file_put_contents(ROOTDIR . '/data/scraper-lastlog', $line, FILE_APPEND);
- $return_chunk .= $line;
- }
- return $return_chunk;
- }
- ob_start('ob_logstdout', 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement