roarr
Advanced tools
Comparing version 7.11.0 to 7.11.1
@@ -77,2 +77,5 @@ "use strict"; | ||
else if (typeof a === 'string') { | ||
if (!a.includes('%')) { | ||
throw new Error('When a string parameter is followed by other arguments, then it is assumed that you are attempting to format a message using printf syntax. You either forgot to add printf bindings or if you meant to add context to the log message, pass them in an object as the first parameter.'); | ||
} | ||
message = (0, fast_printf_1.printf)(a, b, c, d, e, f, g, h, i, j); | ||
@@ -79,0 +82,0 @@ } |
@@ -1,4 +0,2 @@ | ||
import type { Logger, MessageEventHandler } from '../types'; | ||
export declare const createMockLogger: (onMessage: MessageEventHandler, parentContext?: { | ||
[x: string]: import("../types").JsonValue<{}> | undefined; | ||
} | undefined) => Logger; | ||
import type { Logger, MessageContext, MessageEventHandler } from '../types'; | ||
export declare const createMockLogger: (onMessage: MessageEventHandler, parentContext?: MessageContext) => Logger; |
@@ -86,2 +86,8 @@ "use strict"; | ||
}); | ||
(0, ava_1.default)('throws in case of invalid invocation (2)', (t) => { | ||
const log = createLoggerWithHistory(); | ||
t.throws(() => { | ||
log('test', 123); | ||
}); | ||
}); | ||
(0, ava_1.default)('formats message using sprintf', (t) => { | ||
@@ -88,0 +94,0 @@ const log = createLoggerWithHistory(); |
@@ -75,3 +75,3 @@ { | ||
"typings": "./dist/src/Roarr.d.ts", | ||
"version": "7.11.0" | ||
"version": "7.11.1" | ||
} |
87013
1791