Log :: exception(): clean extra args declaration
This commit is contained in:
parent
27af166466
commit
f8fa2f9204
1 changed files with 5 additions and 4 deletions
|
@ -302,15 +302,16 @@ class Log {
|
|||
* @param Throwable $exception
|
||||
* @param string|null $prefix The prefix of the log message
|
||||
* (optional, default: "An exception occured")
|
||||
* @param array $extra_args Extra arguments to use to compute prefix using sprintf
|
||||
* @return void
|
||||
*/
|
||||
public static function exception($exception, $prefix=null) {
|
||||
public static function exception($exception, $prefix=null, ...$extra_args) {
|
||||
SentryIntegration :: log($exception);
|
||||
// If more than 2 arguments passed, format prefix message using sprintf
|
||||
if ($prefix && func_num_args() > 2) {
|
||||
// If extra arguments passed, format prefix message using sprintf
|
||||
if ($prefix && $extra_args) {
|
||||
$prefix = call_user_func_array(
|
||||
'sprintf',
|
||||
array_merge(array($prefix), array_slice(func_get_args(), 2))
|
||||
array_merge(array($prefix), $extra_args)
|
||||
);
|
||||
}
|
||||
self :: error(
|
||||
|
|
Loading…
Reference in a new issue