-
Notifications
You must be signed in to change notification settings - Fork 2
LogTrait
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Traits\LogTrait adds convenient logging methods to classes.
log(string $description, string $type = 'notice', string $subtext = ''): voidlogError(string $description, string $subtext = ''): voidlogWarning(string $description, string $subtext = ''): voiddisableLogBar(): void
final class OrderService {
use \Pair\Traits\LogTrait;
public function run(): void {
$this->log('Order sync started');
try {
// business logic
} catch (\Throwable $e) {
$this->logError('Order sync failed', $e->getMessage());
}
}
}- Helpful in services/controllers that need structured logs with minimal boilerplate.