Better logs
This commit is contained in:
parent
4aa913bc97
commit
129cce4165
|
@ -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:
|
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
|
```php
|
||||||
try {
|
try {
|
||||||
//
|
// stuff
|
||||||
} catch (\danog\MadelineProto\Exception $e) {
|
} catch (\danog\MadelineProto\Exception $e) {
|
||||||
$estring = (string) $e;
|
$estring = (string) $e;
|
||||||
$estring2 = 'This also works: '.$e;
|
$estring2 = 'This also works: '.$e;
|
||||||
|
|
|
@ -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).
|
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
|
```php
|
||||||
$MadelineProto->logger->logger($message, $level);
|
$MadelineProto->logger->logger($message, $level);
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue