Jake Vanderwerf
2026-09-18 a6413da67a4579866f0fd0323ddb23a7b6b9654a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
 
namespace JVBase\inc\managers;
 
use JVBase\managers\Errors;
 
trait ErrorHelper
{
    /**
     * Log errors with proper context
     */
    protected function logError(string $message, string $caller, array $context = []): void
    {
        Errors::log($message, array_merge([
            'class' => static::class,
            'method' => $caller,
        ], $context));
    }
 
    protected static function staticLogError(string $message, string $caller, array $context = []): void
    {
        Errors::log($message, array_merge([
            'class' => static::class,
            'method' => $caller,
        ], $context));
    }
}