| @@ 104-116 (lines=13) @@ | ||
| 101 | * @throws \InvalidArgumentException |
|
| 102 | * @throws \Exception |
|
| 103 | */ |
|
| 104 | public static function initErrorLog($path) |
|
| 105 | { |
|
| 106 | if ($path === null || $path === '') { |
|
| 107 | throw new TelegramLogException('Empty path for error log'); |
|
| 108 | } |
|
| 109 | self::initialize(); |
|
| 110 | self::$error_log_path = $path; |
|
| 111 | ||
| 112 | return self::$monolog->pushHandler( |
|
| 113 | (new StreamHandler(self::$error_log_path, Logger::ERROR)) |
|
| 114 | ->setFormatter(new LineFormatter(null, null, true)) |
|
| 115 | ); |
|
| 116 | } |
|
| 117 | ||
| 118 | /** |
|
| 119 | * Initialize debug log |
|
| @@ 128-140 (lines=13) @@ | ||
| 125 | * @throws \InvalidArgumentException |
|
| 126 | * @throws \Exception |
|
| 127 | */ |
|
| 128 | public static function initDebugLog($path) |
|
| 129 | { |
|
| 130 | if ($path === null || $path === '') { |
|
| 131 | throw new TelegramLogException('Empty path for debug log'); |
|
| 132 | } |
|
| 133 | self::initialize(); |
|
| 134 | self::$debug_log_path = $path; |
|
| 135 | ||
| 136 | return self::$monolog->pushHandler( |
|
| 137 | (new StreamHandler(self::$debug_log_path, Logger::DEBUG)) |
|
| 138 | ->setFormatter(new LineFormatter(null, null, true)) |
|
| 139 | ); |
|
| 140 | } |
|
| 141 | ||
| 142 | /** |
|
| 143 | * Get the stream handle of the temporary debug output |
|