private static function generateStackTrace(array &$context) {
        if (!key_exists('trace', $context)) {
            $trace = DebugHelper::fixTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), __FILE__, __LINE__);

            foreach ($trace as $i => $frame) {
                if (!isset($frame['class']) || $frame['class']!=__CLASS__)      // remove non-logger frames
                    break;
                unset($trace[$i]);
            }
            $context['trace'] = \array_values($trace);
        }
    }