node_modules/opentracing/src/span.js
/**
     * Add a log record to this Span, optionally at a user-provided timestamp.
     *
     * For example:
     *
     *     span.log({
     *         size: rpc.size(),  // numeric value
     *         URI: rpc.URI(),  // string value
     *         payload: rpc.payload(),  // Object value
     *         "keys can be arbitrary strings": rpc.foo(),
     *     });
     *
     *     span.log({
     *         "error.description": someError.description(),
     *     }, someError.timestampMillis());
     *
     * @param {object} keyValuePairs
     *        An object mapping string keys to arbitrary value types. All
     *        Tracer implementations should support bool, string, and numeric
     *        value types, and some may also support Object values.
     * @param {number} timestamp
     *        An optional parameter specifying the timestamp in milliseconds
     *        since the Unix epoch. Fractional values are allowed so that
     *        timestamps with sub-millisecond accuracy can be represented. If
     *        not specified, the implementation is expected to use its notion
     *        of the current time of the call.
     */
Add a log record to this Span, optionally at a user-provided timestamp.
For example.





@param {object} keyValuePairs
An object mapping string keys to arbitrary value types. All
Tracer implementations should support bool, string, and numeric
value types, and some may also support Object values.
@param {number} timestamp
An optional parameter specifying the timestamp in milliseconds
since the Unix epoch. Fractional values are allowed so that
timestamps with sub-millisecond accuracy can be represented. If
not specified, the implementation is expected to use its notion
of the current time of the call.
Add a log record to this Span optionally at a user - provided timestamp . For example . @param { object } keyValuePairs An object mapping string keys to arbitrary value types . All Tracer implementations should support bool string and numeric value types and some may also support Object values . @param { number } timestamp An optional parameter specifying the timestamp in milliseconds since the Unix epoch . Fractional values are allowed so that timestamps with sub - millisecond accuracy can be represented . If not specified the implementation is expected to use its notion of the current time of the call .
log(keyValuePairs, timestamp) {
        if (process.env.NODE_ENV === 'debug') {
            if (arguments.length > 2 || arguments.length === 0) {
                throw new Error('Invalid number of arguments');
            }
            if (arguments.length === 2) {
                if (typeof timestamp !== 'number') {
                    throw new Error('Expected timestamp to be a number');
                }
            }
            if (typeof keyValuePairs !== 'object') {
                throw new Error('Expected keyValuePairs to be an object');
            }
        }
        this._log(keyValuePairs, timestamp);
        return this;
    }
log ( keyValuePairs , timestamp ) { if ( process . env . NODE_ENV === 'debug' ) { if ( arguments . length > 2 || arguments . length === 0 ) { throw new Error ( 'Invalid number of arguments' ) ; } if ( arguments . length === 2 ) { if ( typeof timestamp !== 'number' ) { throw new Error ( 'Expected timestamp to be a number' ) ; } } if ( typeof keyValuePairs !== 'object' ) { throw new Error ( 'Expected keyValuePairs to be an object' ) ; } } this . _log ( keyValuePairs , timestamp ) ; return this ; }
Add a log record to this Span, optionally at a user-provided timestamp.
Add a log record to this Span optionally at a user - provided timestamp .
// Debug-only runtime checks on the arguments