public function trace($msg = null, $data = [], $function = null, $file = null, $line = null, $internal = false)
        {
            // Don't incur the overhead if not in debug mode
            if (!static::$debug) {
                return false;
            }

            // Build log entry
            if (null !== $msg) {
                $entry = array(
                    'message'   => $msg,
                    'data'      => $data,
                    'function'  => $function,
                    'file'      => $file,
                    'line'      => $line,
                    'internal'  => (int) $internal
                );

                // Only log time & memory for non-internal method calls
                if (!$internal) {
                    $currentTime = microtime(true);
                    $currentMemory = memory_get_usage();
                    $entry += array(
                        'time' => ($currentTime - static::$traceTimeLast),
                        'time_total' => $currentTime - static::$traceTimeStart,
                        'memory' => $currentMemory - static::$traceMemoryLast,
                        'memory_total' => $currentMemory - static::$traceMemoryStart
                        );
                    // Store as last run
                    static::$traceTimeLast = $currentTime;
                    static::$traceMemoryLast = $currentMemory;
                }

                static::$trace[] = $entry;
            }

            return static::$trace;
        }