Better logs

This commit is contained in:
Daniil Gentili 2019-06-05 16:57:41 +02:00
parent 4aa913bc97
commit 129cce4165
2 changed files with 10 additions and 1 deletions

View File

@ -97,9 +97,13 @@ $MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => 'h
To get the whole TL trace as string, cast the exception object to string:
**NOTE**: Due to the async nature of MadelineProto 4.0, sometimes the exception that is thrown and logged may not be the actual exception that caused the crash of the script.
To let me properly debug the issue, when reporting issues you also have to provide [**full logs**](LOGGING.html).
```php
try {
//
// stuff
} catch (\danog\MadelineProto\Exception $e) {
$estring = (string) $e;
$estring2 = 'This also works: '.$e;

View File

@ -7,6 +7,11 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
MadelineProto provides a unified class for logging messages to the logging destination defined in [settings](SETTINGS.html#settingslogger).
Use the [settings](SETTINGS.html#settingslogger) to modify the default logging destination and log verbosity.
Note: when running from web, MadelineProto will also automatically enable logging of **PHP errors** (not MadelineProto logs) to `MadelineProto.log`, located in the same directory as the script that loaded MadelineProto.
```php
$MadelineProto->logger->logger($message, $level);
```