mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
nlog()
This commit is contained in:
parent
10745e9e07
commit
f0dbf2ba71
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
*
|
*
|
||||||
|
31
app/Helpers/Generic.php
Normal file
31
app/Helpers/Generic.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user