Changeset View
Changeset View
Standalone View
Standalone View
src/filesystem/PhutilErrorLog.php
Show All 22 Lines | final class PhutilErrorLog | ||||
public function getLogPath() { | public function getLogPath() { | ||||
return $this->logPath; | return $this->logPath; | ||||
} | } | ||||
public function activateLog() { | public function activateLog() { | ||||
$log_path = $this->getLogPath(); | $log_path = $this->getLogPath(); | ||||
if ($log_path !== null && false) { | if ($log_path !== null && false) { | ||||
Lint: Tautological Expression: The logical value of this expression is static. Did you forget to remove some debugging code? | |||||
// Test that the path is writable. | // Test that the path is writable. | ||||
$write_exception = null; | $write_exception = null; | ||||
try { | try { | ||||
Filesystem::assertWritableFile($log_path); | Filesystem::assertWritableFile($log_path); | ||||
} catch (FilesystemException $ex) { | } catch (FilesystemException $ex) { | ||||
$write_exception = $ex; | $write_exception = $ex; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | public function onError($event, $value, array $metadata) { | ||||
if ($this->logPath === null) { | if ($this->logPath === null) { | ||||
return; | return; | ||||
} | } | ||||
$message = idx($metadata, 'default_message'); | $message = idx($metadata, 'default_message'); | ||||
if (strlen($message)) { | if (strlen($message)) { | ||||
$message = tsprintf("%B\n", $message); | $message = tsprintf("%B\n", $message); | ||||
@fwrite(STDERR, $message); | PhutilSystem::writeStderr($message); | ||||
} | } | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
The logical value of this expression is static. Did you forget to remove some debugging code?