public static function formatLogEntry( array $entry, $newline = true )
    {
        $_level = Option::get( $entry, 'level' );
        $_levelName = static::_getLogLevel( $_level );
        $_timestamp = Option::get( $entry, 'timestamp' );
        $_message = preg_replace( '/\033\[[\d;]+m/', null, Option::get( $entry, 'message' ) );
        $_context = Option::get( $entry, 'context' );
        $_extra = Option::get( $entry, 'extra' );

        $_blob = new \stdClass();

        if ( static::$_includeProcessInfo )
        {
            $_blob->pid = getmypid();
            $_blob->uid = getmyuid();
            $_blob->hostname = gethostname();
        }

        if ( !empty( $_context ) )
        {
            $_blob->context = $_context;
        }

        if ( !empty( $_extra ) )
        {
            $_context->extra = $_extra;
        }

        $_blob = json_encode( $_blob );

        if ( false === $_blob || '{}' == $_blob )
        {
            $_blob = null;
        }

        $_replacements = array(
            0 => $_levelName,
            1 => date( 'M d', $_timestamp ),
            2 => date( 'H:i:s', $_timestamp ),
            3 => $_message,
            4 => $_blob,
        );

        return str_ireplace(
            array(
                '%%level%%',
                '%%date%%',
                '%%time%%',
                '%%message%%',
                '%%extra%%',
            ),
            $_replacements,
            static::$_logFormat
        ) . ( $newline ? PHP_EOL : null );
    }