keboola / php-component

General library for PHP applications running in Keboola Connection environment
MIT License
0 stars 1 forks source link

Improve logging #30

Closed tomasfejfar closed 6 years ago

tomasfejfar commented 6 years ago

Ref.: #29


throw new UserException('Error message', 1001, new RuntimeException());

C:\dev\php\php.exe W:\keboola\php-component\example\run.php
Error message

Process finished with exit code 1

throw new InvalidArgumentException('Error message', 1001, new RuntimeException());

C:\dev\php\php.exe W:\keboola\php-component\example\run.php
[2018-05-15 09:25:09] php-component.CRITICAL: InvalidArgumentException:Error message {"errFile":"W:\\keboola\\php-component\\example\\run.php","errLine":13,"errCode":1001,"errTrace":"#0 {main}","errPrevious":"RuntimeException"} []

Process finished with exit code 2

throw new InvalidArgumentException('Error message', 1001);

C:\dev\php\php.exe W:\keboola\php-component\example\run.php
[2018-05-15 09:25:51] php-component.CRITICAL: InvalidArgumentException:Error message {"errFile":"W:\\keboola\\php-component\\example\\run.php","errLine":14,"errCode":1001,"errTrace":"#0 {main}","errPrevious":""} []

Process finished with exit code 2
odinuv commented 6 years ago

overeno