Jake Vanderwerf
8 days ago 90f5c3069f23f63036ab0178ff9ab69effcfb2ea
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));
    }
}