This commit is contained in:
Benjamin Beganović 2020-12-24 17:01:34 +01:00
parent 10745e9e07
commit f0dbf2ba71
2 changed files with 32 additions and 0 deletions

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Invoice Ninja (https://invoiceninja.com). * Invoice Ninja (https://invoiceninja.com).
* *

31
app/Helpers/Generic.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
/**
* Simple helper function that will log into "invoiceninja.log" file
* only when extended logging is enabled.
*
* @param mixed $output
* @param array $context
*
* @return void
*/
function nlog($output, $context = []): void
{
if (config('ninja.expanded_logging')) {
if (gettype($output) == 'object') {
$output = print_r($output, 1);
}
\Illuminate\Support\Facades\Log::channel('invoiceninja')->info($output, $context);
}
}