public function logInternal($message, $type, $time, $context = [])
{
if (!$this->enabled) {
return;
}
$trace = null;
if ($this->options['traceable']) {
$trace = debug_backtrace();
}
$log = $this->getFormatter()->format($message, $type, $time, $context, $trace, count($this->logs));
$this->logs[] = $log;
// flush if this is not transaction
if (!$this->isTransaction) {
$this->flush();
}
}