| 1 | <?php |
||
| 4 | class Log |
||
| 5 | { |
||
| 6 | /** @var int */ |
||
| 7 | private $ownerPid; |
||
| 8 | |||
| 9 | /** @var int */ |
||
| 10 | private $masterPid; |
||
| 11 | |||
| 12 | /** @var resource */ |
||
| 13 | private $destination; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param int $ownerPid |
||
| 17 | */ |
||
| 18 | public function __construct($ownerPid) |
||
| 22 | |||
| 23 | public function setMasterProcessId($pid) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * sets the resource for the log. |
||
| 30 | * |
||
| 31 | * @param resource $resource |
||
| 32 | * @return void |
||
| 33 | */ |
||
| 34 | public function setDestination($resource) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * writes log |
||
| 41 | * |
||
| 42 | * @param string $type |
||
| 43 | * @param string $message |
||
| 44 | * @return void |
||
| 45 | */ |
||
| 46 | private function write($type, $message) |
||
| 75 | |||
| 76 | /** |
||
| 77 | * writes log |
||
| 78 | * |
||
| 79 | * @param string $message |
||
| 80 | * @return void |
||
| 81 | */ |
||
| 82 | public function info($message) |
||
| 86 | |||
| 87 | /** |
||
| 88 | * writes log |
||
| 89 | * |
||
| 90 | * @param string $message |
||
| 91 | * @return void |
||
| 92 | */ |
||
| 93 | public function error($message) |
||
| 97 | } |
||
| 98 |