Skip to content

Commit eaf790f

Browse files
authored
Update Log.php
使用error_log函数代替fwrite记录日志。
1 parent 896a4d4 commit eaf790f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/Resque/Log.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@ public function __construct($verbose = false) {
2525
public function log($level, $message, array $context = array())
2626
{
2727
if ($this->verbose) {
28-
fwrite(
29-
STDOUT,
28+
error_log(
3029
'[' . $level . '] [' . strftime('%T %Y-%m-%d') . '] ' . $this->interpolate($message, $context) . PHP_EOL
3130
);
3231
return;
3332
}
3433

3534
if (!($level === Psr\Log\LogLevel::INFO || $level === Psr\Log\LogLevel::DEBUG)) {
36-
fwrite(
37-
STDOUT,
35+
error_log(
3836
'[' . $level . '] ' . $this->interpolate($message, $context) . PHP_EOL
3937
);
4038
}

0 commit comments

Comments
 (0)