2020-12-24 17:01:34 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-12-24 17:01:34 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Simple helper function that will log into "invoiceninja.log" file
|
|
|
|
* only when extended logging is enabled.
|
|
|
|
*
|
2020-12-25 12:29:42 +01:00
|
|
|
* @param mixed $output
|
|
|
|
* @param array $context
|
|
|
|
*
|
|
|
|
* @return void
|
2020-12-24 17:01:34 +01:00
|
|
|
*/
|
|
|
|
function nlog($output, $context = []): void
|
|
|
|
{
|
2021-01-14 10:31:27 +01:00
|
|
|
|
2021-01-15 00:50:27 +01:00
|
|
|
if (!config('ninja.expanded_logging'))
|
|
|
|
return;
|
2021-01-14 10:31:27 +01:00
|
|
|
|
2020-12-24 17:01:34 +01:00
|
|
|
if (gettype($output) == 'object') {
|
|
|
|
$output = print_r($output, 1);
|
|
|
|
}
|
|
|
|
|
2021-01-15 00:50:27 +01:00
|
|
|
$trace = debug_backtrace();
|
2021-01-20 02:59:39 +01:00
|
|
|
// \Illuminate\Support\Facades\Log::channel('invoiceninja')->info(print_r($trace[1]['class'],1), []);
|
2020-12-24 17:01:34 +01:00
|
|
|
\Illuminate\Support\Facades\Log::channel('invoiceninja')->info($output, $context);
|
2021-01-15 00:50:27 +01:00
|
|
|
|
2020-12-24 17:01:34 +01:00
|
|
|
}
|
2021-01-09 05:10:48 +01:00
|
|
|
|
2021-01-30 02:13:32 +01:00
|
|
|
// if (!function_exists('ray')) {
|
|
|
|
// function ray($payload)
|
|
|
|
// {
|
|
|
|
// return true;
|
|
|
|
// }
|
|
|
|
// }
|
2021-01-09 05:10:48 +01:00
|
|
|
|