standard-log 8.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -133
- package/{esm/console/createConsoleLogReporter.d.ts → cjs/console.d.ts} +5 -5
- package/cjs/console.d.ts.map +1 -0
- package/cjs/console.js +76 -0
- package/cjs/console.js.map +1 -0
- package/cjs/console.spec.d.ts +2 -0
- package/cjs/console.spec.d.ts.map +1 -0
- package/cjs/{console/createConsoleLogReporter.spec.js → console.spec.js} +50 -55
- package/cjs/console.spec.js.map +1 -0
- package/cjs/errors.d.ts +1 -11
- package/cjs/errors.d.ts.map +1 -1
- package/cjs/errors.js +3 -45
- package/cjs/errors.js.map +1 -1
- package/cjs/formatter.d.ts +6 -0
- package/cjs/formatter.d.ts.map +1 -0
- package/cjs/formatter.js +46 -0
- package/cjs/formatter.js.map +1 -0
- package/cjs/formatter.spec.d.ts +2 -0
- package/cjs/formatter.spec.d.ts.map +1 -0
- package/cjs/formatter.spec.js +32 -0
- package/cjs/formatter.spec.js.map +1 -0
- package/cjs/index.d.ts +5 -14
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +5 -14
- package/cjs/index.js.map +1 -1
- package/cjs/logLevels.d.ts +60 -0
- package/cjs/logLevels.d.ts.map +1 -0
- package/cjs/logLevels.js +87 -0
- package/cjs/logLevels.js.map +1 -0
- package/cjs/logStore.d.ts +20 -0
- package/cjs/logStore.d.ts.map +1 -0
- package/cjs/logStore.js +44 -0
- package/cjs/logStore.js.map +1 -0
- package/cjs/logStore.spec.d.ts +2 -0
- package/cjs/logStore.spec.d.ts.map +1 -0
- package/cjs/logStore.spec.js +93 -0
- package/cjs/logStore.spec.js.map +1 -0
- package/cjs/logger.d.ts +6 -0
- package/cjs/logger.d.ts.map +1 -0
- package/cjs/logger.js +97 -0
- package/cjs/logger.js.map +1 -0
- package/{esm/memory/MemoryLogReporter.d.ts → cjs/memory.d.ts} +2 -2
- package/cjs/memory.d.ts.map +1 -0
- package/cjs/memory.js +39 -0
- package/cjs/memory.js.map +1 -0
- package/cjs/memory.spec.d.ts +2 -0
- package/cjs/memory.spec.d.ts.map +1 -0
- package/cjs/memory.spec.js +115 -0
- package/cjs/memory.spec.js.map +1 -0
- package/cjs/package.json +1 -3
- package/cjs/platform.browser.d.ts +7 -0
- package/cjs/platform.browser.d.ts.map +1 -0
- package/cjs/platform.browser.js +11 -0
- package/cjs/platform.browser.js.map +1 -0
- package/cjs/platform.d.ts +8 -0
- package/cjs/platform.d.ts.map +1 -0
- package/cjs/platform.js +26 -0
- package/cjs/platform.js.map +1 -0
- package/cjs/platform.spec.d.ts +2 -0
- package/cjs/platform.spec.d.ts.map +1 -0
- package/cjs/platform.spec.js +22 -0
- package/cjs/platform.spec.js.map +1 -0
- package/cjs/standardLog.d.ts +21 -0
- package/cjs/standardLog.d.ts.map +1 -0
- package/cjs/standardLog.js +59 -0
- package/cjs/standardLog.js.map +1 -0
- package/cjs/standardLog.spec.d.ts +2 -0
- package/cjs/standardLog.spec.d.ts.map +1 -0
- package/cjs/standardLog.spec.js +548 -0
- package/cjs/standardLog.spec.js.map +1 -0
- package/cjs/testUtil.d.ts +7 -4
- package/cjs/testUtil.d.ts.map +1 -1
- package/cjs/testUtil.js +16 -13
- package/cjs/testUtil.js.map +1 -1
- package/cjs/types.d.ts +33 -24
- package/cjs/types.d.ts.map +1 -1
- package/cjs/types.js.map +1 -1
- package/dist/standard-log.es5.js +326 -1079
- package/dist/standard-log.es5.js.gz +0 -0
- package/dist/standard-log.es5.js.map +1 -1
- package/dist/standard-log.es5.js.map.gz +0 -0
- package/dist/standard-log.esm.js +309 -1146
- package/dist/standard-log.esm.js.gz +0 -0
- package/dist/standard-log.esm.js.map +1 -1
- package/dist/standard-log.esm.js.map.gz +0 -0
- package/{cjs/console/createConsoleLogReporter.d.ts → esm/console.d.ts} +5 -5
- package/esm/console.d.ts.map +1 -0
- package/esm/{console/polyfilledConsole.js → console.js} +36 -4
- package/esm/console.js.map +1 -0
- package/esm/console.spec.d.ts +2 -0
- package/esm/console.spec.d.ts.map +1 -0
- package/esm/{console/createConsoleLogReporter.spec.js → console.spec.js} +50 -52
- package/esm/console.spec.js.map +1 -0
- package/esm/errors.d.ts +1 -11
- package/esm/errors.d.ts.map +1 -1
- package/esm/errors.js +2 -36
- package/esm/errors.js.map +1 -1
- package/esm/formatter.d.ts +6 -0
- package/esm/formatter.d.ts.map +1 -0
- package/esm/{formatter/createTimestampFormatter.js → formatter.js} +10 -2
- package/esm/formatter.js.map +1 -0
- package/esm/formatter.spec.d.ts +2 -0
- package/esm/formatter.spec.d.ts.map +1 -0
- package/esm/formatter.spec.js +30 -0
- package/esm/formatter.spec.js.map +1 -0
- package/esm/index.d.ts +5 -14
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +5 -14
- package/esm/index.js.map +1 -1
- package/esm/logLevels.d.ts +60 -0
- package/esm/logLevels.d.ts.map +1 -0
- package/esm/{logLevel.js → logLevels.js} +29 -3
- package/esm/logLevels.js.map +1 -0
- package/esm/logStore.d.ts +20 -0
- package/esm/logStore.d.ts.map +1 -0
- package/esm/logStore.js +37 -0
- package/esm/logStore.js.map +1 -0
- package/esm/logStore.spec.d.ts +2 -0
- package/esm/logStore.spec.d.ts.map +1 -0
- package/esm/logStore.spec.js +93 -0
- package/esm/logStore.spec.js.map +1 -0
- package/esm/logger.d.ts +6 -0
- package/esm/logger.d.ts.map +1 -0
- package/esm/logger.js +74 -0
- package/esm/logger.js.map +1 -0
- package/{cjs/memory/MemoryLogReporter.d.ts → esm/memory.d.ts} +2 -2
- package/esm/memory.d.ts.map +1 -0
- package/esm/memory.js +34 -0
- package/esm/memory.js.map +1 -0
- package/esm/memory.spec.d.ts +2 -0
- package/esm/memory.spec.d.ts.map +1 -0
- package/esm/memory.spec.js +110 -0
- package/esm/memory.spec.js.map +1 -0
- package/esm/platform.browser.d.ts +7 -0
- package/esm/platform.browser.d.ts.map +1 -0
- package/esm/platform.browser.js +6 -0
- package/esm/platform.browser.js.map +1 -0
- package/esm/platform.d.ts +8 -0
- package/esm/platform.d.ts.map +1 -0
- package/esm/platform.js +20 -0
- package/esm/platform.js.map +1 -0
- package/esm/platform.spec.d.ts +2 -0
- package/esm/platform.spec.d.ts.map +1 -0
- package/esm/{console/semverGt.spec.js → platform.spec.js} +2 -2
- package/esm/platform.spec.js.map +1 -0
- package/esm/standardLog.d.ts +21 -0
- package/esm/standardLog.d.ts.map +1 -0
- package/esm/standardLog.js +36 -0
- package/esm/standardLog.js.map +1 -0
- package/esm/standardLog.spec.d.ts +2 -0
- package/esm/standardLog.spec.d.ts.map +1 -0
- package/esm/standardLog.spec.js +446 -0
- package/esm/standardLog.spec.js.map +1 -0
- package/esm/testUtil.d.ts +7 -4
- package/esm/testUtil.d.ts.map +1 -1
- package/esm/testUtil.js +11 -11
- package/esm/testUtil.js.map +1 -1
- package/esm/types.d.ts +33 -24
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js.map +1 -1
- package/package.json +12 -20
- package/ts/console.ts +72 -0
- package/ts/errors.ts +2 -14
- package/ts/{formatter/createTimestampFormatter.ts → formatter.ts} +12 -1
- package/ts/index.ts +5 -14
- package/ts/{logLevel.ts → logLevels.ts} +20 -3
- package/ts/logStore.ts +52 -0
- package/ts/logger.ts +85 -0
- package/ts/memory.ts +47 -0
- package/ts/platform.browser.ts +8 -0
- package/ts/platform.ts +25 -0
- package/ts/standardLog.ts +54 -0
- package/ts/types.ts +39 -30
- package/cjs/LogEntry.d.ts +0 -7
- package/cjs/LogEntry.d.ts.map +0 -1
- package/cjs/LogEntry.js +0 -3
- package/cjs/LogEntry.js.map +0 -1
- package/cjs/captureLogs.d.ts +0 -4
- package/cjs/captureLogs.d.ts.map +0 -1
- package/cjs/captureLogs.js +0 -33
- package/cjs/captureLogs.js.map +0 -1
- package/cjs/captureLogs.spec.d.ts +0 -2
- package/cjs/captureLogs.spec.d.ts.map +0 -1
- package/cjs/captureLogs.spec.js +0 -117
- package/cjs/captureLogs.spec.js.map +0 -1
- package/cjs/config.d.ts +0 -12
- package/cjs/config.d.ts.map +0 -1
- package/cjs/config.js +0 -59
- package/cjs/config.js.map +0 -1
- package/cjs/config.spec.d.ts +0 -2
- package/cjs/config.spec.d.ts.map +0 -1
- package/cjs/config.spec.js +0 -66
- package/cjs/config.spec.js.map +0 -1
- package/cjs/configForTest.d.ts +0 -5
- package/cjs/configForTest.d.ts.map +0 -1
- package/cjs/configForTest.js +0 -18
- package/cjs/configForTest.js.map +0 -1
- package/cjs/configForTest.spec.d.ts +0 -2
- package/cjs/configForTest.spec.d.ts.map +0 -1
- package/cjs/configForTest.spec.js +0 -17
- package/cjs/configForTest.spec.js.map +0 -1
- package/cjs/console/createConsoleLogReporter.d.ts.map +0 -1
- package/cjs/console/createConsoleLogReporter.js +0 -42
- package/cjs/console/createConsoleLogReporter.js.map +0 -1
- package/cjs/console/createConsoleLogReporter.spec.d.ts +0 -2
- package/cjs/console/createConsoleLogReporter.spec.d.ts.map +0 -1
- package/cjs/console/createConsoleLogReporter.spec.js.map +0 -1
- package/cjs/console/index.d.ts +0 -4
- package/cjs/console/index.d.ts.map +0 -1
- package/cjs/console/index.js +0 -20
- package/cjs/console/index.js.map +0 -1
- package/cjs/console/isConsoleDebugAvailable.d.ts +0 -2
- package/cjs/console/isConsoleDebugAvailable.d.ts.map +0 -1
- package/cjs/console/isConsoleDebugAvailable.js +0 -20
- package/cjs/console/isConsoleDebugAvailable.js.map +0 -1
- package/cjs/console/polyfilledConsole.d.ts +0 -7
- package/cjs/console/polyfilledConsole.d.ts.map +0 -1
- package/cjs/console/polyfilledConsole.js +0 -41
- package/cjs/console/polyfilledConsole.js.map +0 -1
- package/cjs/console/semverGt.d.ts +0 -2
- package/cjs/console/semverGt.d.ts.map +0 -1
- package/cjs/console/semverGt.js +0 -13
- package/cjs/console/semverGt.js.map +0 -1
- package/cjs/console/semverGt.spec.d.ts +0 -2
- package/cjs/console/semverGt.spec.d.ts.map +0 -1
- package/cjs/console/semverGt.spec.js +0 -22
- package/cjs/console/semverGt.spec.js.map +0 -1
- package/cjs/console/toConsoleMethod.d.ts +0 -2
- package/cjs/console/toConsoleMethod.d.ts.map +0 -1
- package/cjs/console/toConsoleMethod.js +0 -22
- package/cjs/console/toConsoleMethod.js.map +0 -1
- package/cjs/console/types.d.ts +0 -3
- package/cjs/console/types.d.ts.map +0 -1
- package/cjs/console/types.js +0 -3
- package/cjs/console/types.js.map +0 -1
- package/cjs/customLogLevel.d.ts +0 -11
- package/cjs/customLogLevel.d.ts.map +0 -1
- package/cjs/customLogLevel.js +0 -38
- package/cjs/customLogLevel.js.map +0 -1
- package/cjs/customLogLevel.spec.d.ts +0 -2
- package/cjs/customLogLevel.spec.d.ts.map +0 -1
- package/cjs/customLogLevel.spec.js +0 -37
- package/cjs/customLogLevel.spec.js.map +0 -1
- package/cjs/formatter/createTimestampFormatter.d.ts +0 -3
- package/cjs/formatter/createTimestampFormatter.d.ts.map +0 -1
- package/cjs/formatter/createTimestampFormatter.js +0 -26
- package/cjs/formatter/createTimestampFormatter.js.map +0 -1
- package/cjs/formatter/createTimestampFormatter.spec.d.ts +0 -2
- package/cjs/formatter/createTimestampFormatter.spec.d.ts.map +0 -1
- package/cjs/formatter/createTimestampFormatter.spec.js +0 -23
- package/cjs/formatter/createTimestampFormatter.spec.js.map +0 -1
- package/cjs/formatter/formatLogLevel.d.ts +0 -2
- package/cjs/formatter/formatLogLevel.d.ts.map +0 -1
- package/cjs/formatter/formatLogLevel.js +0 -10
- package/cjs/formatter/formatLogLevel.js.map +0 -1
- package/cjs/formatter/index.d.ts +0 -4
- package/cjs/formatter/index.d.ts.map +0 -1
- package/cjs/formatter/index.js +0 -20
- package/cjs/formatter/index.js.map +0 -1
- package/cjs/formatter/plainLogFormatter.d.ts +0 -3
- package/cjs/formatter/plainLogFormatter.d.ts.map +0 -1
- package/cjs/formatter/plainLogFormatter.js +0 -19
- package/cjs/formatter/plainLogFormatter.js.map +0 -1
- package/cjs/formatter/plainLogFormatter.spec.d.ts +0 -2
- package/cjs/formatter/plainLogFormatter.spec.d.ts.map +0 -1
- package/cjs/formatter/plainLogFormatter.spec.js +0 -9
- package/cjs/formatter/plainLogFormatter.spec.js.map +0 -1
- package/cjs/getDefaultReporter.browser.d.ts +0 -2
- package/cjs/getDefaultReporter.browser.d.ts.map +0 -1
- package/cjs/getDefaultReporter.browser.js +0 -15
- package/cjs/getDefaultReporter.browser.js.map +0 -1
- package/cjs/getDefaultReporter.d.ts +0 -2
- package/cjs/getDefaultReporter.d.ts.map +0 -1
- package/cjs/getDefaultReporter.js +0 -19
- package/cjs/getDefaultReporter.js.map +0 -1
- package/cjs/getLogModeFromEnvironment.browser.d.ts +0 -3
- package/cjs/getLogModeFromEnvironment.browser.d.ts.map +0 -1
- package/cjs/getLogModeFromEnvironment.browser.js +0 -9
- package/cjs/getLogModeFromEnvironment.browser.js.map +0 -1
- package/cjs/getLogModeFromEnvironment.d.ts +0 -3
- package/cjs/getLogModeFromEnvironment.d.ts.map +0 -1
- package/cjs/getLogModeFromEnvironment.js +0 -17
- package/cjs/getLogModeFromEnvironment.js.map +0 -1
- package/cjs/getLogModeFromEnvironment.spec.d.ts +0 -2
- package/cjs/getLogModeFromEnvironment.spec.d.ts.map +0 -1
- package/cjs/getLogModeFromEnvironment.spec.js +0 -19
- package/cjs/getLogModeFromEnvironment.spec.js.map +0 -1
- package/cjs/getLogger.d.ts +0 -9
- package/cjs/getLogger.d.ts.map +0 -1
- package/cjs/getLogger.js +0 -103
- package/cjs/getLogger.js.map +0 -1
- package/cjs/getLogger.spec.d.ts +0 -2
- package/cjs/getLogger.spec.d.ts.map +0 -1
- package/cjs/getLogger.spec.js +0 -481
- package/cjs/getLogger.spec.js.map +0 -1
- package/cjs/getLoggers.d.ts +0 -7
- package/cjs/getLoggers.d.ts.map +0 -1
- package/cjs/getLoggers.js +0 -15
- package/cjs/getLoggers.js.map +0 -1
- package/cjs/logLevel.d.ts +0 -106
- package/cjs/logLevel.d.ts.map +0 -1
- package/cjs/logLevel.js +0 -59
- package/cjs/logLevel.js.map +0 -1
- package/cjs/logLevel.spec.d.ts +0 -2
- package/cjs/logLevel.spec.d.ts.map +0 -1
- package/cjs/logLevel.spec.js +0 -195
- package/cjs/logLevel.spec.js.map +0 -1
- package/cjs/logLevelFn.d.ts +0 -20
- package/cjs/logLevelFn.d.ts.map +0 -1
- package/cjs/logLevelFn.js +0 -76
- package/cjs/logLevelFn.js.map +0 -1
- package/cjs/logReporter.d.ts +0 -7
- package/cjs/logReporter.d.ts.map +0 -1
- package/cjs/logReporter.js +0 -29
- package/cjs/logReporter.js.map +0 -1
- package/cjs/logReporter.spec.d.ts +0 -2
- package/cjs/logReporter.spec.d.ts.map +0 -1
- package/cjs/logReporter.spec.js +0 -86
- package/cjs/logReporter.spec.js.map +0 -1
- package/cjs/logReporterInternal.d.ts +0 -3
- package/cjs/logReporterInternal.d.ts.map +0 -1
- package/cjs/logReporterInternal.js +0 -23
- package/cjs/logReporterInternal.js.map +0 -1
- package/cjs/memory/MemoryLogReporter.d.ts.map +0 -1
- package/cjs/memory/MemoryLogReporter.js +0 -56
- package/cjs/memory/MemoryLogReporter.js.map +0 -1
- package/cjs/memory/MemoryLogReporter.spec.d.ts +0 -2
- package/cjs/memory/MemoryLogReporter.spec.d.ts.map +0 -1
- package/cjs/memory/MemoryLogReporter.spec.js +0 -111
- package/cjs/memory/MemoryLogReporter.spec.js.map +0 -1
- package/cjs/memory/index.d.ts +0 -3
- package/cjs/memory/index.d.ts.map +0 -1
- package/cjs/memory/index.js +0 -19
- package/cjs/memory/index.js.map +0 -1
- package/cjs/memory/logEntriesToString.d.ts +0 -3
- package/cjs/memory/logEntriesToString.d.ts.map +0 -1
- package/cjs/memory/logEntriesToString.js +0 -10
- package/cjs/memory/logEntriesToString.js.map +0 -1
- package/cjs/memory/logEntriesToString.spec.d.ts +0 -2
- package/cjs/memory/logEntriesToString.spec.d.ts.map +0 -1
- package/cjs/memory/logEntriesToString.spec.js +0 -36
- package/cjs/memory/logEntriesToString.spec.js.map +0 -1
- package/cjs/memory/toInspectStringForObject.d.ts +0 -3
- package/cjs/memory/toInspectStringForObject.d.ts.map +0 -1
- package/cjs/memory/toInspectStringForObject.js +0 -17
- package/cjs/memory/toInspectStringForObject.js.map +0 -1
- package/cjs/shouldLog.d.ts +0 -8
- package/cjs/shouldLog.d.ts.map +0 -1
- package/cjs/shouldLog.js +0 -14
- package/cjs/shouldLog.js.map +0 -1
- package/cjs/store.d.ts +0 -3
- package/cjs/store.d.ts.map +0 -1
- package/cjs/store.js +0 -27
- package/cjs/store.js.map +0 -1
- package/cjs/suppressLogs.d.ts +0 -6
- package/cjs/suppressLogs.d.ts.map +0 -1
- package/cjs/suppressLogs.js +0 -17
- package/cjs/suppressLogs.js.map +0 -1
- package/cjs/suppressLogs.spec.d.ts +0 -2
- package/cjs/suppressLogs.spec.d.ts.map +0 -1
- package/cjs/suppressLogs.spec.js +0 -31
- package/cjs/suppressLogs.spec.js.map +0 -1
- package/cjs/typesInternal.d.ts +0 -20
- package/cjs/typesInternal.d.ts.map +0 -1
- package/cjs/typesInternal.js +0 -3
- package/cjs/typesInternal.js.map +0 -1
- package/cjs/utils.d.ts +0 -5
- package/cjs/utils.d.ts.map +0 -1
- package/cjs/utils.js +0 -14
- package/cjs/utils.js.map +0 -1
- package/cjs/writeToReporters.d.ts +0 -6
- package/cjs/writeToReporters.d.ts.map +0 -1
- package/cjs/writeToReporters.js +0 -22
- package/cjs/writeToReporters.js.map +0 -1
- package/cjs/writeToReporters.spec.d.ts +0 -2
- package/cjs/writeToReporters.spec.d.ts.map +0 -1
- package/cjs/writeToReporters.spec.js +0 -59
- package/cjs/writeToReporters.spec.js.map +0 -1
- package/esm/LogEntry.d.ts +0 -7
- package/esm/LogEntry.d.ts.map +0 -1
- package/esm/LogEntry.js +0 -2
- package/esm/LogEntry.js.map +0 -1
- package/esm/captureLogs.d.ts +0 -4
- package/esm/captureLogs.d.ts.map +0 -1
- package/esm/captureLogs.js +0 -29
- package/esm/captureLogs.js.map +0 -1
- package/esm/captureLogs.spec.d.ts +0 -2
- package/esm/captureLogs.spec.d.ts.map +0 -1
- package/esm/captureLogs.spec.js +0 -45
- package/esm/captureLogs.spec.js.map +0 -1
- package/esm/config.d.ts +0 -12
- package/esm/config.d.ts.map +0 -1
- package/esm/config.js +0 -44
- package/esm/config.js.map +0 -1
- package/esm/config.spec.d.ts +0 -2
- package/esm/config.spec.d.ts.map +0 -1
- package/esm/config.spec.js +0 -61
- package/esm/config.spec.js.map +0 -1
- package/esm/configForTest.d.ts +0 -5
- package/esm/configForTest.d.ts.map +0 -1
- package/esm/configForTest.js +0 -14
- package/esm/configForTest.js.map +0 -1
- package/esm/configForTest.spec.d.ts +0 -2
- package/esm/configForTest.spec.d.ts.map +0 -1
- package/esm/configForTest.spec.js +0 -15
- package/esm/configForTest.spec.js.map +0 -1
- package/esm/console/createConsoleLogReporter.d.ts.map +0 -1
- package/esm/console/createConsoleLogReporter.js +0 -37
- package/esm/console/createConsoleLogReporter.js.map +0 -1
- package/esm/console/createConsoleLogReporter.spec.d.ts +0 -2
- package/esm/console/createConsoleLogReporter.spec.d.ts.map +0 -1
- package/esm/console/createConsoleLogReporter.spec.js.map +0 -1
- package/esm/console/index.d.ts +0 -4
- package/esm/console/index.d.ts.map +0 -1
- package/esm/console/index.js +0 -4
- package/esm/console/index.js.map +0 -1
- package/esm/console/isConsoleDebugAvailable.d.ts +0 -2
- package/esm/console/isConsoleDebugAvailable.d.ts.map +0 -1
- package/esm/console/isConsoleDebugAvailable.js +0 -13
- package/esm/console/isConsoleDebugAvailable.js.map +0 -1
- package/esm/console/polyfilledConsole.d.ts +0 -7
- package/esm/console/polyfilledConsole.d.ts.map +0 -1
- package/esm/console/polyfilledConsole.js.map +0 -1
- package/esm/console/semverGt.d.ts +0 -2
- package/esm/console/semverGt.d.ts.map +0 -1
- package/esm/console/semverGt.js +0 -9
- package/esm/console/semverGt.js.map +0 -1
- package/esm/console/semverGt.spec.d.ts +0 -2
- package/esm/console/semverGt.spec.d.ts.map +0 -1
- package/esm/console/semverGt.spec.js.map +0 -1
- package/esm/console/toConsoleMethod.d.ts +0 -2
- package/esm/console/toConsoleMethod.d.ts.map +0 -1
- package/esm/console/toConsoleMethod.js +0 -18
- package/esm/console/toConsoleMethod.js.map +0 -1
- package/esm/console/types.d.ts +0 -3
- package/esm/console/types.d.ts.map +0 -1
- package/esm/console/types.js +0 -2
- package/esm/console/types.js.map +0 -1
- package/esm/customLogLevel.d.ts +0 -11
- package/esm/customLogLevel.d.ts.map +0 -1
- package/esm/customLogLevel.js +0 -30
- package/esm/customLogLevel.js.map +0 -1
- package/esm/customLogLevel.spec.d.ts +0 -2
- package/esm/customLogLevel.spec.d.ts.map +0 -1
- package/esm/customLogLevel.spec.js +0 -32
- package/esm/customLogLevel.spec.js.map +0 -1
- package/esm/formatter/createTimestampFormatter.d.ts +0 -3
- package/esm/formatter/createTimestampFormatter.d.ts.map +0 -1
- package/esm/formatter/createTimestampFormatter.js.map +0 -1
- package/esm/formatter/createTimestampFormatter.spec.d.ts +0 -2
- package/esm/formatter/createTimestampFormatter.spec.d.ts.map +0 -1
- package/esm/formatter/createTimestampFormatter.spec.js +0 -21
- package/esm/formatter/createTimestampFormatter.spec.js.map +0 -1
- package/esm/formatter/formatLogLevel.d.ts +0 -2
- package/esm/formatter/formatLogLevel.d.ts.map +0 -1
- package/esm/formatter/formatLogLevel.js +0 -6
- package/esm/formatter/formatLogLevel.js.map +0 -1
- package/esm/formatter/index.d.ts +0 -4
- package/esm/formatter/index.d.ts.map +0 -1
- package/esm/formatter/index.js +0 -4
- package/esm/formatter/index.js.map +0 -1
- package/esm/formatter/plainLogFormatter.d.ts +0 -3
- package/esm/formatter/plainLogFormatter.d.ts.map +0 -1
- package/esm/formatter/plainLogFormatter.js +0 -5
- package/esm/formatter/plainLogFormatter.js.map +0 -1
- package/esm/formatter/plainLogFormatter.spec.d.ts +0 -2
- package/esm/formatter/plainLogFormatter.spec.d.ts.map +0 -1
- package/esm/formatter/plainLogFormatter.spec.js +0 -7
- package/esm/formatter/plainLogFormatter.spec.js.map +0 -1
- package/esm/getDefaultReporter.browser.d.ts +0 -2
- package/esm/getDefaultReporter.browser.d.ts.map +0 -1
- package/esm/getDefaultReporter.browser.js +0 -11
- package/esm/getDefaultReporter.browser.js.map +0 -1
- package/esm/getDefaultReporter.d.ts +0 -2
- package/esm/getDefaultReporter.d.ts.map +0 -1
- package/esm/getDefaultReporter.js +0 -15
- package/esm/getDefaultReporter.js.map +0 -1
- package/esm/getLogModeFromEnvironment.browser.d.ts +0 -3
- package/esm/getLogModeFromEnvironment.browser.d.ts.map +0 -1
- package/esm/getLogModeFromEnvironment.browser.js +0 -5
- package/esm/getLogModeFromEnvironment.browser.js.map +0 -1
- package/esm/getLogModeFromEnvironment.d.ts +0 -3
- package/esm/getLogModeFromEnvironment.d.ts.map +0 -1
- package/esm/getLogModeFromEnvironment.js +0 -13
- package/esm/getLogModeFromEnvironment.js.map +0 -1
- package/esm/getLogModeFromEnvironment.spec.d.ts +0 -2
- package/esm/getLogModeFromEnvironment.spec.d.ts.map +0 -1
- package/esm/getLogModeFromEnvironment.spec.js +0 -14
- package/esm/getLogModeFromEnvironment.spec.js.map +0 -1
- package/esm/getLogger.d.ts +0 -9
- package/esm/getLogger.d.ts.map +0 -1
- package/esm/getLogger.js +0 -78
- package/esm/getLogger.js.map +0 -1
- package/esm/getLogger.spec.d.ts +0 -2
- package/esm/getLogger.spec.d.ts.map +0 -1
- package/esm/getLogger.spec.js +0 -381
- package/esm/getLogger.spec.js.map +0 -1
- package/esm/getLoggers.d.ts +0 -7
- package/esm/getLoggers.d.ts.map +0 -1
- package/esm/getLoggers.js +0 -11
- package/esm/getLoggers.js.map +0 -1
- package/esm/logLevel.d.ts +0 -106
- package/esm/logLevel.d.ts.map +0 -1
- package/esm/logLevel.js.map +0 -1
- package/esm/logLevel.spec.d.ts +0 -2
- package/esm/logLevel.spec.d.ts.map +0 -1
- package/esm/logLevel.spec.js +0 -148
- package/esm/logLevel.spec.js.map +0 -1
- package/esm/logLevelFn.d.ts +0 -20
- package/esm/logLevelFn.d.ts.map +0 -1
- package/esm/logLevelFn.js +0 -67
- package/esm/logLevelFn.js.map +0 -1
- package/esm/logReporter.d.ts +0 -7
- package/esm/logReporter.d.ts.map +0 -1
- package/esm/logReporter.js +0 -21
- package/esm/logReporter.js.map +0 -1
- package/esm/logReporter.spec.d.ts +0 -2
- package/esm/logReporter.spec.d.ts.map +0 -1
- package/esm/logReporter.spec.js +0 -81
- package/esm/logReporter.spec.js.map +0 -1
- package/esm/logReporterInternal.d.ts +0 -3
- package/esm/logReporterInternal.d.ts.map +0 -1
- package/esm/logReporterInternal.js +0 -19
- package/esm/logReporterInternal.js.map +0 -1
- package/esm/memory/MemoryLogReporter.d.ts.map +0 -1
- package/esm/memory/MemoryLogReporter.js +0 -51
- package/esm/memory/MemoryLogReporter.js.map +0 -1
- package/esm/memory/MemoryLogReporter.spec.d.ts +0 -2
- package/esm/memory/MemoryLogReporter.spec.d.ts.map +0 -1
- package/esm/memory/MemoryLogReporter.spec.js +0 -98
- package/esm/memory/MemoryLogReporter.spec.js.map +0 -1
- package/esm/memory/index.d.ts +0 -3
- package/esm/memory/index.d.ts.map +0 -1
- package/esm/memory/index.js +0 -3
- package/esm/memory/index.js.map +0 -1
- package/esm/memory/logEntriesToString.d.ts +0 -3
- package/esm/memory/logEntriesToString.d.ts.map +0 -1
- package/esm/memory/logEntriesToString.js +0 -6
- package/esm/memory/logEntriesToString.js.map +0 -1
- package/esm/memory/logEntriesToString.spec.d.ts +0 -2
- package/esm/memory/logEntriesToString.spec.d.ts.map +0 -1
- package/esm/memory/logEntriesToString.spec.js +0 -42
- package/esm/memory/logEntriesToString.spec.js.map +0 -1
- package/esm/memory/toInspectStringForObject.d.ts +0 -3
- package/esm/memory/toInspectStringForObject.d.ts.map +0 -1
- package/esm/memory/toInspectStringForObject.js +0 -11
- package/esm/memory/toInspectStringForObject.js.map +0 -1
- package/esm/shouldLog.d.ts +0 -8
- package/esm/shouldLog.d.ts.map +0 -1
- package/esm/shouldLog.js +0 -10
- package/esm/shouldLog.js.map +0 -1
- package/esm/store.d.ts +0 -3
- package/esm/store.d.ts.map +0 -1
- package/esm/store.js +0 -24
- package/esm/store.js.map +0 -1
- package/esm/suppressLogs.d.ts +0 -6
- package/esm/suppressLogs.d.ts.map +0 -1
- package/esm/suppressLogs.js +0 -9
- package/esm/suppressLogs.js.map +0 -1
- package/esm/suppressLogs.spec.d.ts +0 -2
- package/esm/suppressLogs.spec.d.ts.map +0 -1
- package/esm/suppressLogs.spec.js +0 -29
- package/esm/suppressLogs.spec.js.map +0 -1
- package/esm/typesInternal.d.ts +0 -20
- package/esm/typesInternal.d.ts.map +0 -1
- package/esm/typesInternal.js +0 -2
- package/esm/typesInternal.js.map +0 -1
- package/esm/utils.d.ts +0 -5
- package/esm/utils.d.ts.map +0 -1
- package/esm/utils.js +0 -10
- package/esm/utils.js.map +0 -1
- package/esm/writeToReporters.d.ts +0 -6
- package/esm/writeToReporters.d.ts.map +0 -1
- package/esm/writeToReporters.js +0 -18
- package/esm/writeToReporters.js.map +0 -1
- package/esm/writeToReporters.spec.d.ts +0 -2
- package/esm/writeToReporters.spec.d.ts.map +0 -1
- package/esm/writeToReporters.spec.js +0 -9
- package/esm/writeToReporters.spec.js.map +0 -1
- package/ts/LogEntry.ts +0 -7
- package/ts/captureLogs.ts +0 -35
- package/ts/config.ts +0 -57
- package/ts/configForTest.ts +0 -16
- package/ts/console/createConsoleLogReporter.ts +0 -42
- package/ts/console/index.ts +0 -3
- package/ts/console/isConsoleDebugAvailable.ts +0 -11
- package/ts/console/polyfilledConsole.ts +0 -34
- package/ts/console/semverGt.ts +0 -9
- package/ts/console/toConsoleMethod.ts +0 -18
- package/ts/console/types.ts +0 -3
- package/ts/customLogLevel.ts +0 -35
- package/ts/formatter/formatLogLevel.ts +0 -6
- package/ts/formatter/index.ts +0 -3
- package/ts/formatter/plainLogFormatter.ts +0 -6
- package/ts/getDefaultReporter.browser.ts +0 -13
- package/ts/getDefaultReporter.ts +0 -15
- package/ts/getLogModeFromEnvironment.browser.ts +0 -6
- package/ts/getLogModeFromEnvironment.ts +0 -16
- package/ts/getLogger.ts +0 -92
- package/ts/getLoggers.ts +0 -12
- package/ts/logLevelFn.ts +0 -72
- package/ts/logReporter.ts +0 -26
- package/ts/logReporterInternal.ts +0 -18
- package/ts/memory/MemoryLogReporter.ts +0 -66
- package/ts/memory/index.ts +0 -2
- package/ts/memory/logEntriesToString.ts +0 -7
- package/ts/memory/toInspectStringForObject.ts +0 -13
- package/ts/shouldLog.ts +0 -11
- package/ts/store.ts +0 -25
- package/ts/suppressLogs.ts +0 -14
- package/ts/testUtil.ts +0 -19
- package/ts/typesInternal.ts +0 -21
- package/ts/utils.ts +0 -9
- package/ts/writeToReporters.ts +0 -20
package/cjs/getLogger.spec.js
DELETED
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
var assertron_1 = __importDefault(require("assertron"));
|
|
43
|
-
var delay_1 = __importDefault(require("delay"));
|
|
44
|
-
var index_js_1 = require("./index.js");
|
|
45
|
-
var config_js_1 = require("./config.js");
|
|
46
|
-
var index_js_2 = require("./memory/index.js");
|
|
47
|
-
var store_js_1 = require("./store.js");
|
|
48
|
-
var testUtil_js_1 = require("./testUtil.js");
|
|
49
|
-
afterEach(function () {
|
|
50
|
-
(0, index_js_1.clearCustomLogLevel)();
|
|
51
|
-
store_js_1.store.reset();
|
|
52
|
-
});
|
|
53
|
-
test('logger id supports alphanumeric and :_-.', function () {
|
|
54
|
-
(0, index_js_1.getLogger)('abcdefghijklmnopqrstuvwxyz:-_.1234567890');
|
|
55
|
-
});
|
|
56
|
-
test('logger id supports unicode', function () {
|
|
57
|
-
(0, index_js_1.getLogger)('ミク香港');
|
|
58
|
-
});
|
|
59
|
-
test('logger id supports @, \\ and /', function () {
|
|
60
|
-
(0, index_js_1.getLogger)('@unional/fixture');
|
|
61
|
-
(0, index_js_1.getLogger)("a\\b\\c");
|
|
62
|
-
});
|
|
63
|
-
test.each('`~!#$%^&*()=+|[]{}<>,?'.split(''))('throws if id has unsupported character %s', function (char) {
|
|
64
|
-
assertron_1.default.throws(function () { return (0, index_js_1.getLogger)(char); }, index_js_1.InvalidId);
|
|
65
|
-
});
|
|
66
|
-
test('get logger with same name gets the same instance', function () {
|
|
67
|
-
var expected = (0, index_js_1.getLogger)('same-inst');
|
|
68
|
-
var actual = (0, index_js_1.getLogger)('same-inst');
|
|
69
|
-
expect(actual).toBe(expected);
|
|
70
|
-
});
|
|
71
|
-
test('can specify local log level', function () {
|
|
72
|
-
var log = (0, index_js_1.getLogger)('local', { level: index_js_1.logLevels.trace });
|
|
73
|
-
expect(log.level).toBe(index_js_1.logLevels.trace);
|
|
74
|
-
});
|
|
75
|
-
test('new logger will get custom level', function () {
|
|
76
|
-
(0, index_js_1.addCustomLogLevel)('to_logger', 1234);
|
|
77
|
-
var actual = (0, index_js_1.getLogger)('to_logger_logger');
|
|
78
|
-
expect(typeof actual.to_logger).toBe('function');
|
|
79
|
-
});
|
|
80
|
-
test('existing logger will get custom level', function () {
|
|
81
|
-
var actual = (0, index_js_1.getLogger)('old_logger');
|
|
82
|
-
(0, index_js_1.addCustomLogLevel)('old_logger', 122);
|
|
83
|
-
expect(typeof actual.old_logger).toBe('function');
|
|
84
|
-
});
|
|
85
|
-
describe('validate write to reporters', function () {
|
|
86
|
-
var capture;
|
|
87
|
-
beforeEach(function () {
|
|
88
|
-
store_js_1.store.value.mode = 'test';
|
|
89
|
-
store_js_1.store.value.logLevel = index_js_1.logLevels.debug;
|
|
90
|
-
capture = (0, testUtil_js_1.captureWrittenLog)();
|
|
91
|
-
});
|
|
92
|
-
afterEach(function () {
|
|
93
|
-
capture.reset();
|
|
94
|
-
});
|
|
95
|
-
test('logger with custom level', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
-
var logger;
|
|
97
|
-
return __generator(this, function (_a) {
|
|
98
|
-
(0, index_js_1.addCustomLogLevel)('cust_lvl', 100);
|
|
99
|
-
logger = (0, index_js_1.getLogger)('cust');
|
|
100
|
-
logger.cust_lvl('a', 'b');
|
|
101
|
-
assertron_1.default.satisfies(capture.logs, [{ id: 'cust', level: 100, args: ['a', 'b'] }]);
|
|
102
|
-
return [2 /*return*/];
|
|
103
|
-
});
|
|
104
|
-
}); });
|
|
105
|
-
describe('count()', function () {
|
|
106
|
-
test('will increment the counter', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
-
var logger;
|
|
108
|
-
return __generator(this, function (_a) {
|
|
109
|
-
logger = (0, index_js_1.getLogger)('inc counter');
|
|
110
|
-
logger.count();
|
|
111
|
-
logger.count();
|
|
112
|
-
assertron_1.default.satisfies(capture.logs, [
|
|
113
|
-
{ id: 'inc counter', level: index_js_1.logLevels.debug, args: [1] },
|
|
114
|
-
{ id: 'inc counter', level: index_js_1.logLevels.debug, args: [2] }
|
|
115
|
-
]);
|
|
116
|
-
return [2 /*return*/];
|
|
117
|
-
});
|
|
118
|
-
}); });
|
|
119
|
-
test('append args after the counter', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
-
var id, logger;
|
|
121
|
-
return __generator(this, function (_a) {
|
|
122
|
-
store_js_1.store.value.logLevel = index_js_1.logLevels.debug;
|
|
123
|
-
id = 'inc with args';
|
|
124
|
-
logger = (0, index_js_1.getLogger)(id);
|
|
125
|
-
logger.count('msg1', 'msg2');
|
|
126
|
-
assertron_1.default.satisfies(capture.logs, [
|
|
127
|
-
{ id: id, level: index_js_1.logLevels.debug, args: [1, 'msg1', 'msg2'] }
|
|
128
|
-
]);
|
|
129
|
-
return [2 /*return*/];
|
|
130
|
-
});
|
|
131
|
-
}); });
|
|
132
|
-
test('not log if log level is less than debug', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
|
-
var id, logger;
|
|
134
|
-
return __generator(this, function (_a) {
|
|
135
|
-
store_js_1.store.value.logLevel = index_js_1.logLevels.debug - 1;
|
|
136
|
-
id = 'inc with args';
|
|
137
|
-
logger = (0, index_js_1.getLogger)(id);
|
|
138
|
-
logger.count('msg1', 'msg2');
|
|
139
|
-
expect(capture.logs.length).toBe(0);
|
|
140
|
-
return [2 /*return*/];
|
|
141
|
-
});
|
|
142
|
-
}); });
|
|
143
|
-
});
|
|
144
|
-
describe('log level tests', function () {
|
|
145
|
-
beforeEach(function () {
|
|
146
|
-
store_js_1.store.value.mode = 'test';
|
|
147
|
-
store_js_1.store.value.logLevel = index_js_1.logLevels.error;
|
|
148
|
-
});
|
|
149
|
-
afterEach(function () {
|
|
150
|
-
store_js_1.store.reset();
|
|
151
|
-
});
|
|
152
|
-
function assertLoggedAtLevel(log, level) {
|
|
153
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
-
var msg;
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
(0, index_js_1.setLogLevel)(level);
|
|
157
|
-
msg = "should log on level: ".concat(level);
|
|
158
|
-
log[log.id](msg);
|
|
159
|
-
assertron_1.default.satisfies(capture.logs, [{ id: log.id, level: (0, index_js_1.toLogLevel)(log.id), args: [msg] }]);
|
|
160
|
-
return [2 /*return*/];
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
function assertNotLoggedAtLevel(log, level) {
|
|
165
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
-
return __generator(this, function (_a) {
|
|
167
|
-
(0, index_js_1.setLogLevel)(level);
|
|
168
|
-
log[log.id]("should not log on level: ".concat(level));
|
|
169
|
-
expect(capture.logs.length).toBe(0);
|
|
170
|
-
return [2 /*return*/];
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
function assertLoggedAtLocalLevel(log, globalLevel, localLevel) {
|
|
175
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
176
|
-
var msg;
|
|
177
|
-
return __generator(this, function (_a) {
|
|
178
|
-
(0, index_js_1.setLogLevel)(globalLevel);
|
|
179
|
-
log.level = localLevel;
|
|
180
|
-
msg = "should log on level: ".concat(localLevel);
|
|
181
|
-
log[log.id](msg);
|
|
182
|
-
assertron_1.default.satisfies(capture.logs, [{ id: log.id, level: (0, index_js_1.toLogLevel)(log.id), args: [msg] }]);
|
|
183
|
-
return [2 /*return*/];
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function assertNotLoggedAtLocalLevel(log, globalLevel, localLevel) {
|
|
188
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
189
|
-
return __generator(this, function (_a) {
|
|
190
|
-
(0, index_js_1.setLogLevel)(globalLevel);
|
|
191
|
-
log.level = localLevel;
|
|
192
|
-
log[log.id]("should not log on level: ".concat(localLevel));
|
|
193
|
-
expect(capture.logs.length).toBe(0);
|
|
194
|
-
return [2 /*return*/];
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function assertLogFunctionCalledAtLevel(log, callLevel, actualLevel) {
|
|
199
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
-
var actual;
|
|
201
|
-
return __generator(this, function (_a) {
|
|
202
|
-
(0, index_js_1.setLogLevel)(actualLevel);
|
|
203
|
-
actual = false;
|
|
204
|
-
log.on(callLevel, function () { return actual = true; });
|
|
205
|
-
expect(actual).toBe(true);
|
|
206
|
-
return [2 /*return*/];
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function assertLogFunctionCalledAtLocalLevel(log, callLevel, globalLevel, localLevel) {
|
|
211
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
212
|
-
var actual;
|
|
213
|
-
return __generator(this, function (_a) {
|
|
214
|
-
(0, index_js_1.setLogLevel)(globalLevel);
|
|
215
|
-
log.level = localLevel;
|
|
216
|
-
actual = false;
|
|
217
|
-
log.on(callLevel, function () { return actual = true; });
|
|
218
|
-
expect(actual).toBe(true);
|
|
219
|
-
return [2 /*return*/];
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
function assertLogFunctionNotCalledAtLevel(log, callLevel, actualLevel) {
|
|
224
|
-
(0, index_js_1.setLogLevel)(actualLevel);
|
|
225
|
-
log.on(callLevel, function () { throw new Error("should not log at level ".concat(actualLevel)); });
|
|
226
|
-
}
|
|
227
|
-
function assertLogFunctionNotCalledAtLocalLevel(log, callLevel, globalLevel, localLevel) {
|
|
228
|
-
(0, index_js_1.setLogLevel)(globalLevel);
|
|
229
|
-
log.level = localLevel;
|
|
230
|
-
log.on(callLevel, function () { throw new Error("should not log at local level ".concat(localLevel)); });
|
|
231
|
-
}
|
|
232
|
-
var shouldLog = wrapTest(function (test) { return function (method, level) {
|
|
233
|
-
var name = (0, index_js_1.toLogLevelName)(level);
|
|
234
|
-
test("".concat(method, "() should log on level: ").concat(name, " (").concat(level, ")"), function () {
|
|
235
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
236
|
-
return assertLoggedAtLevel(log, level);
|
|
237
|
-
});
|
|
238
|
-
}; });
|
|
239
|
-
var shouldNotLog = wrapTest(function (test) { return function (method, level) {
|
|
240
|
-
var name = (0, index_js_1.toLogLevelName)(level);
|
|
241
|
-
test("".concat(method, "() should not log on level: ").concat(name, " (").concat(level, ")"), function () {
|
|
242
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
243
|
-
return assertNotLoggedAtLevel(log, level);
|
|
244
|
-
});
|
|
245
|
-
}; });
|
|
246
|
-
var shouldLogWithLocalLevelOverride = wrapTest(function (test) { return function (method, localLevel) {
|
|
247
|
-
var localName = (0, index_js_1.toLogLevelName)(localLevel);
|
|
248
|
-
[index_js_1.logLevels.none, index_js_1.logLevels.error, index_js_1.logLevels.warn, index_js_1.logLevels.info, index_js_1.logLevels.debug].forEach(function (globalLevel) {
|
|
249
|
-
var globalName = (0, index_js_1.toLogLevelName)(globalLevel) || 'none';
|
|
250
|
-
test("".concat(method, "() should log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
|
|
251
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
252
|
-
return assertLoggedAtLocalLevel(log, globalLevel, localLevel);
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
}; });
|
|
256
|
-
var shouldNotLogWithLocalLevelOverride = wrapTest(function (test) { return function (method, localLevel) {
|
|
257
|
-
var localName = (0, index_js_1.toLogLevelName)(localLevel);
|
|
258
|
-
[index_js_1.logLevels.none, index_js_1.logLevels.error, index_js_1.logLevels.warn, index_js_1.logLevels.info, index_js_1.logLevels.debug].forEach(function (globalLevel) {
|
|
259
|
-
var globalName = (0, index_js_1.toLogLevelName)(globalLevel) || 'none';
|
|
260
|
-
test("".concat(method, "() should not log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
|
|
261
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
262
|
-
return assertNotLoggedAtLocalLevel(log, globalLevel, localLevel);
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
}; });
|
|
266
|
-
var shouldCallLogFunction = wrapTest(function (test) { return function (callLevel, actualLevel) {
|
|
267
|
-
var method = (0, index_js_1.toLogLevelName)(callLevel);
|
|
268
|
-
var name = (0, index_js_1.toLogLevelName)(actualLevel);
|
|
269
|
-
test("".concat(method, "() should call log function on level: ").concat(name, " (").concat(actualLevel, ")"), function () {
|
|
270
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
271
|
-
return assertLogFunctionCalledAtLevel(log, callLevel, actualLevel);
|
|
272
|
-
});
|
|
273
|
-
}; });
|
|
274
|
-
var shouldNotCallLogFunction = wrapTest(function (test) { return function (callLevel, actualLevel) {
|
|
275
|
-
var method = (0, index_js_1.toLogLevelName)(callLevel);
|
|
276
|
-
var name = (0, index_js_1.toLogLevelName)(actualLevel);
|
|
277
|
-
test("".concat(method, "() should not call log function on level: ").concat(name, " (").concat(actualLevel, ")"), function () {
|
|
278
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
279
|
-
assertLogFunctionNotCalledAtLevel(log, callLevel, actualLevel);
|
|
280
|
-
});
|
|
281
|
-
}; });
|
|
282
|
-
var shouldCallLogFunctionWithLocalLevelOverride = wrapTest(function (test) { return function (callLevel, localLevel) {
|
|
283
|
-
var method = (0, index_js_1.toLogLevelName)(callLevel);
|
|
284
|
-
var localName = (0, index_js_1.toLogLevelName)(localLevel);
|
|
285
|
-
[index_js_1.logLevels.none, index_js_1.logLevels.error, index_js_1.logLevels.warn, index_js_1.logLevels.info, index_js_1.logLevels.debug].forEach(function (globalLevel) {
|
|
286
|
-
var globalName = (0, index_js_1.toLogLevelName)(globalLevel) || 'none';
|
|
287
|
-
test("".concat(method, "() should log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
|
|
288
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
289
|
-
return assertLogFunctionCalledAtLocalLevel(log, callLevel, globalLevel, localLevel);
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
}; });
|
|
293
|
-
var shouldNotCallLogFunctionWithLocalLevelOverride = wrapTest(function (test) { return function (callLevel, localLevel) {
|
|
294
|
-
var method = (0, index_js_1.toLogLevelName)(callLevel);
|
|
295
|
-
var localName = (0, index_js_1.toLogLevelName)(localLevel);
|
|
296
|
-
[index_js_1.logLevels.none, index_js_1.logLevels.error, index_js_1.logLevels.warn, index_js_1.logLevels.info, index_js_1.logLevels.debug].forEach(function (globalLevel) {
|
|
297
|
-
var globalName = (0, index_js_1.toLogLevelName)(globalLevel) || 'none';
|
|
298
|
-
test("".concat(method, "() should not log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
|
|
299
|
-
var log = (0, index_js_1.getLogger)(method);
|
|
300
|
-
assertLogFunctionNotCalledAtLocalLevel(log, callLevel, globalLevel, localLevel);
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
}; });
|
|
304
|
-
function wrapTest(fn) {
|
|
305
|
-
return Object.assign(fn(test), { only: fn(test.only), skip: fn(test.skip) });
|
|
306
|
-
}
|
|
307
|
-
shouldNotLog('error', index_js_1.logLevels.none);
|
|
308
|
-
shouldLog('error', index_js_1.logLevels.error);
|
|
309
|
-
shouldLog('error', index_js_1.logLevels.warn);
|
|
310
|
-
shouldLog('error', index_js_1.logLevels.info);
|
|
311
|
-
shouldLog('error', index_js_1.logLevels.debug);
|
|
312
|
-
shouldNotLogWithLocalLevelOverride('error', index_js_1.logLevels.none);
|
|
313
|
-
shouldLogWithLocalLevelOverride('error', index_js_1.logLevels.error);
|
|
314
|
-
shouldLogWithLocalLevelOverride('error', index_js_1.logLevels.warn);
|
|
315
|
-
shouldLogWithLocalLevelOverride('error', index_js_1.logLevels.info);
|
|
316
|
-
shouldLogWithLocalLevelOverride('error', index_js_1.logLevels.debug);
|
|
317
|
-
shouldNotLog('warn', index_js_1.logLevels.none);
|
|
318
|
-
shouldNotLog('warn', index_js_1.logLevels.error);
|
|
319
|
-
shouldLog('warn', index_js_1.logLevels.warn);
|
|
320
|
-
shouldLog('warn', index_js_1.logLevels.info);
|
|
321
|
-
shouldLog('warn', index_js_1.logLevels.debug);
|
|
322
|
-
shouldNotLogWithLocalLevelOverride('warn', index_js_1.logLevels.none);
|
|
323
|
-
shouldNotLogWithLocalLevelOverride('warn', index_js_1.logLevels.error);
|
|
324
|
-
shouldLogWithLocalLevelOverride('warn', index_js_1.logLevels.warn);
|
|
325
|
-
shouldLogWithLocalLevelOverride('warn', index_js_1.logLevels.info);
|
|
326
|
-
shouldLogWithLocalLevelOverride('warn', index_js_1.logLevels.debug);
|
|
327
|
-
shouldNotLog('info', index_js_1.logLevels.none);
|
|
328
|
-
shouldNotLog('info', index_js_1.logLevels.error);
|
|
329
|
-
shouldNotLog('info', index_js_1.logLevels.warn);
|
|
330
|
-
shouldLog('info', index_js_1.logLevels.info);
|
|
331
|
-
shouldLog('info', index_js_1.logLevels.debug);
|
|
332
|
-
shouldNotLogWithLocalLevelOverride('info', index_js_1.logLevels.none);
|
|
333
|
-
shouldNotLogWithLocalLevelOverride('info', index_js_1.logLevels.error);
|
|
334
|
-
shouldNotLogWithLocalLevelOverride('info', index_js_1.logLevels.warn);
|
|
335
|
-
shouldLogWithLocalLevelOverride('info', index_js_1.logLevels.info);
|
|
336
|
-
shouldLogWithLocalLevelOverride('info', index_js_1.logLevels.debug);
|
|
337
|
-
shouldNotLog('debug', index_js_1.logLevels.none);
|
|
338
|
-
shouldNotLog('debug', index_js_1.logLevels.error);
|
|
339
|
-
shouldNotLog('debug', index_js_1.logLevels.warn);
|
|
340
|
-
shouldNotLog('debug', index_js_1.logLevels.info);
|
|
341
|
-
shouldLog('debug', index_js_1.logLevels.debug);
|
|
342
|
-
shouldNotLogWithLocalLevelOverride('debug', index_js_1.logLevels.none);
|
|
343
|
-
shouldNotLogWithLocalLevelOverride('debug', index_js_1.logLevels.error);
|
|
344
|
-
shouldNotLogWithLocalLevelOverride('debug', index_js_1.logLevels.warn);
|
|
345
|
-
shouldNotLogWithLocalLevelOverride('debug', index_js_1.logLevels.info);
|
|
346
|
-
shouldLogWithLocalLevelOverride('debug', index_js_1.logLevels.debug);
|
|
347
|
-
shouldNotCallLogFunction(index_js_1.logLevels.error, index_js_1.logLevels.none);
|
|
348
|
-
shouldCallLogFunction(index_js_1.logLevels.error, index_js_1.logLevels.error);
|
|
349
|
-
shouldCallLogFunction(index_js_1.logLevels.error, index_js_1.logLevels.warn);
|
|
350
|
-
shouldCallLogFunction(index_js_1.logLevels.error, index_js_1.logLevels.info);
|
|
351
|
-
shouldCallLogFunction(index_js_1.logLevels.error, index_js_1.logLevels.debug);
|
|
352
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.error, index_js_1.logLevels.none);
|
|
353
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.error, index_js_1.logLevels.error);
|
|
354
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.error, index_js_1.logLevels.warn);
|
|
355
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.error, index_js_1.logLevels.info);
|
|
356
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.error, index_js_1.logLevels.debug);
|
|
357
|
-
shouldNotCallLogFunction(index_js_1.logLevels.warn, index_js_1.logLevels.none);
|
|
358
|
-
shouldNotCallLogFunction(index_js_1.logLevels.warn, index_js_1.logLevels.error);
|
|
359
|
-
shouldCallLogFunction(index_js_1.logLevels.warn, index_js_1.logLevels.warn);
|
|
360
|
-
shouldCallLogFunction(index_js_1.logLevels.warn, index_js_1.logLevels.info);
|
|
361
|
-
shouldCallLogFunction(index_js_1.logLevels.warn, index_js_1.logLevels.debug);
|
|
362
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.warn, index_js_1.logLevels.none);
|
|
363
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.warn, index_js_1.logLevels.error);
|
|
364
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.warn, index_js_1.logLevels.warn);
|
|
365
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.warn, index_js_1.logLevels.info);
|
|
366
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.warn, index_js_1.logLevels.debug);
|
|
367
|
-
shouldNotCallLogFunction(index_js_1.logLevels.info, index_js_1.logLevels.none);
|
|
368
|
-
shouldNotCallLogFunction(index_js_1.logLevels.info, index_js_1.logLevels.error);
|
|
369
|
-
shouldNotCallLogFunction(index_js_1.logLevels.info, index_js_1.logLevels.warn);
|
|
370
|
-
shouldCallLogFunction(index_js_1.logLevels.info, index_js_1.logLevels.info);
|
|
371
|
-
shouldCallLogFunction(index_js_1.logLevels.info, index_js_1.logLevels.debug);
|
|
372
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.info, index_js_1.logLevels.none);
|
|
373
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.info, index_js_1.logLevels.error);
|
|
374
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.info, index_js_1.logLevels.warn);
|
|
375
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.info, index_js_1.logLevels.info);
|
|
376
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.info, index_js_1.logLevels.debug);
|
|
377
|
-
shouldNotCallLogFunction(index_js_1.logLevels.debug, index_js_1.logLevels.none);
|
|
378
|
-
shouldNotCallLogFunction(index_js_1.logLevels.debug, index_js_1.logLevels.error);
|
|
379
|
-
shouldNotCallLogFunction(index_js_1.logLevels.debug, index_js_1.logLevels.warn);
|
|
380
|
-
shouldNotCallLogFunction(index_js_1.logLevels.debug, index_js_1.logLevels.info);
|
|
381
|
-
shouldCallLogFunction(index_js_1.logLevels.debug, index_js_1.logLevels.debug);
|
|
382
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.debug, index_js_1.logLevels.none);
|
|
383
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.debug, index_js_1.logLevels.error);
|
|
384
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.debug, index_js_1.logLevels.warn);
|
|
385
|
-
shouldNotCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.debug, index_js_1.logLevels.info);
|
|
386
|
-
shouldCallLogFunctionWithLocalLevelOverride(index_js_1.logLevels.debug, index_js_1.logLevels.debug);
|
|
387
|
-
});
|
|
388
|
-
test('on() log using log argument', function () {
|
|
389
|
-
store_js_1.store.value.mode = 'test';
|
|
390
|
-
store_js_1.store.value.logLevel = index_js_1.logLevels.debug;
|
|
391
|
-
var logger = (0, index_js_1.getLogger)('log on fn');
|
|
392
|
-
logger.on('error', function (log) { log('value'); });
|
|
393
|
-
assertron_1.default.satisfies(capture.logs, [
|
|
394
|
-
{ id: 'log on fn', level: index_js_1.logLevels.error, args: ['value'] }
|
|
395
|
-
]);
|
|
396
|
-
});
|
|
397
|
-
test('write entry directly', function () {
|
|
398
|
-
var log = (0, index_js_1.getLogger)('write-entry');
|
|
399
|
-
var entry = { id: 'write-entry', level: index_js_1.logLevels.info, args: ['abc'], timestamp: new Date() };
|
|
400
|
-
log.write(entry);
|
|
401
|
-
assertron_1.default.satisfies(capture.logs, [entry]);
|
|
402
|
-
});
|
|
403
|
-
});
|
|
404
|
-
test('on() can take log level name in first argument', function () {
|
|
405
|
-
var log = (0, index_js_1.getLogger)('string-on');
|
|
406
|
-
log.on('debug', function () { return; });
|
|
407
|
-
});
|
|
408
|
-
test('auto configure', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
409
|
-
var log;
|
|
410
|
-
return __generator(this, function (_a) {
|
|
411
|
-
switch (_a.label) {
|
|
412
|
-
case 0:
|
|
413
|
-
expect(store_js_1.store.value.configured).toBeFalsy();
|
|
414
|
-
log = (0, index_js_1.getLogger)('auto config');
|
|
415
|
-
log.info('config is called automatically as expected');
|
|
416
|
-
return [4 /*yield*/, (0, delay_1.default)(10)];
|
|
417
|
-
case 1:
|
|
418
|
-
_a.sent();
|
|
419
|
-
expect(store_js_1.store.value.configured).toBeTruthy();
|
|
420
|
-
return [2 /*return*/];
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
}); });
|
|
424
|
-
describe('writeTo', function () {
|
|
425
|
-
var memReporter;
|
|
426
|
-
var specialReporter;
|
|
427
|
-
beforeEach(function () {
|
|
428
|
-
memReporter = (0, index_js_2.createMemoryLogReporter)();
|
|
429
|
-
specialReporter = (0, index_js_2.createMemoryLogReporter)({ id: 'special' });
|
|
430
|
-
(0, config_js_1.config)({ mode: 'test', reporters: [memReporter, specialReporter] });
|
|
431
|
-
});
|
|
432
|
-
test('specific reporter with string', function () {
|
|
433
|
-
var log = (0, index_js_1.getLogger)('writeTo-string', { writeTo: 'special' });
|
|
434
|
-
log.error('error message');
|
|
435
|
-
expect(memReporter.logs.length).toEqual(0);
|
|
436
|
-
expect(specialReporter.logs.length).toEqual(1);
|
|
437
|
-
});
|
|
438
|
-
test('specific reporter with regex', function () {
|
|
439
|
-
var log = (0, index_js_1.getLogger)('writeTo-regex', { writeTo: /^spec/ });
|
|
440
|
-
log.error('error message');
|
|
441
|
-
expect(memReporter.logs.length).toEqual(0);
|
|
442
|
-
expect(specialReporter.logs.length).toEqual(1);
|
|
443
|
-
});
|
|
444
|
-
test('specific reporter with RegExp', function () {
|
|
445
|
-
var log = (0, index_js_1.getLogger)('writeTo-RegExp', { writeTo: new RegExp('^spec') });
|
|
446
|
-
log.error('error message');
|
|
447
|
-
expect(memReporter.logs.length).toEqual(0);
|
|
448
|
-
expect(specialReporter.logs.length).toEqual(1);
|
|
449
|
-
});
|
|
450
|
-
test('specific reporter with function', function () {
|
|
451
|
-
var log = (0, index_js_1.getLogger)('writeTo-fn', { writeTo: function (id) { return id === 'special'; } });
|
|
452
|
-
log.error('error message');
|
|
453
|
-
expect(memReporter.logs.length).toEqual(0);
|
|
454
|
-
expect(specialReporter.logs.length).toEqual(1);
|
|
455
|
-
});
|
|
456
|
-
test('custom reporter', function () {
|
|
457
|
-
var reporter = (0, index_js_2.createMemoryLogReporter)({ id: 'custom mem' });
|
|
458
|
-
var log = (0, index_js_1.getLogger)('writeTo-reporter', { writeTo: reporter });
|
|
459
|
-
log.error('error message');
|
|
460
|
-
expect(reporter.logs.length).toEqual(1);
|
|
461
|
-
});
|
|
462
|
-
test('custom reporter cannot override added console reporter', function () {
|
|
463
|
-
// if not, it would be a security issue as the new reporter
|
|
464
|
-
// can capture the logs from other logger and send it elsewhere
|
|
465
|
-
var reporter = (0, index_js_2.createMemoryLogReporter)({ id: 'custom mem' });
|
|
466
|
-
reporter.isConsoleReporter = true;
|
|
467
|
-
(0, index_js_1.getLogger)('writeTo-reporter-no-override', { writeTo: reporter });
|
|
468
|
-
var log = (0, index_js_1.getLogger)('writeTo-reporter-no-override-2');
|
|
469
|
-
log.error('error message');
|
|
470
|
-
expect(reporter.logs.length).toEqual(0);
|
|
471
|
-
});
|
|
472
|
-
});
|
|
473
|
-
test('id is readonly', function () {
|
|
474
|
-
var log = (0, index_js_1.getLogger)('id is readonly');
|
|
475
|
-
assertron_1.default.throws(function () { return log.id = 'b'; });
|
|
476
|
-
});
|
|
477
|
-
test.each(['on', 'count', 'error', 'warn', 'info', 'debug'])('method %s is readonly', function (name) {
|
|
478
|
-
var log = (0, index_js_1.getLogger)("".concat(name, " is readonly"));
|
|
479
|
-
assertron_1.default.throws(function () { return log[name] = true; });
|
|
480
|
-
});
|
|
481
|
-
//# sourceMappingURL=getLogger.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLogger.spec.js","sourceRoot":"","sources":["../ts/getLogger.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyB;AACzB,gDAAyB;AACzB,uCAAqK;AACrK,yCAAoC;AACpC,8CAA8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,oBAAS,EAAC,gBAAgB,CAAC,CAAA;IAC5C,mBAAC,CAAC,MAAM,CAAC,cAAM,OAAA,GAAG,CAAC,EAAE,GAAG,GAAG,EAAZ,CAAY,CAAC,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,EAAE,UAAA,IAAI;IACxF,IAAM,GAAG,GAAQ,IAAA,oBAAS,EAAC,UAAG,IAAI,iBAAc,CAAC,CAAA;IAEjD,mBAAC,CAAC,MAAM,CAAC,cAAM,OAAA,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAhB,CAAgB,CAAC,CAAA;AAClC,CAAC,CAAC,CAAA","sourcesContent":["import a from 'assertron'\nimport delay from 'delay'\nimport { addCustomLogLevel, clearCustomLogLevel, getLogger, InvalidId, Logger, logLevels, LogMethodNames, setLogLevel, toLogLevel, toLogLevelName } from './index.js'\nimport { config } from './config.js'\nimport { createMemoryLogReporter, MemoryLogReporter } from './memory/index.js'\nimport { store } from './store.js'\nimport { captureWrittenLog } from './testUtil.js'\n\nafterEach(() => {\n clearCustomLogLevel()\n store.reset()\n})\n\ntest('logger id supports alphanumeric and :_-.', () => {\n getLogger('abcdefghijklmnopqrstuvwxyz:-_.1234567890')\n})\n\ntest('logger id supports unicode', () => {\n getLogger('ミク香港')\n})\n\ntest('logger id supports @, \\\\ and /', () => {\n getLogger('@unional/fixture')\n getLogger(`a\\\\b\\\\c`)\n})\n\ntest.each('`~!#$%^&*()=+|[]{}<>,?'.split(''))('throws if id has unsupported character %s', (char: string) => {\n a.throws(() => getLogger(char), InvalidId)\n})\n\ntest('get logger with same name gets the same instance', () => {\n const expected = getLogger('same-inst')\n const actual = getLogger('same-inst')\n expect(actual).toBe(expected)\n})\n\ntest('can specify local log level', () => {\n const log = getLogger('local', { level: logLevels.trace })\n expect(log.level).toBe(logLevels.trace)\n})\n\ntest('new logger will get custom level', () => {\n addCustomLogLevel('to_logger', 1234)\n const actual = getLogger<LogMethodNames | 'to_logger'>('to_logger_logger')\n expect(typeof actual.to_logger).toBe('function')\n})\n\ntest('existing logger will get custom level', () => {\n const actual = getLogger<LogMethodNames | 'old_logger'>('old_logger')\n addCustomLogLevel('old_logger', 122)\n expect(typeof actual.old_logger).toBe('function')\n})\n\ndescribe('validate write to reporters', () => {\n let capture: ReturnType<typeof captureWrittenLog>\n beforeEach(() => {\n store.value.mode = 'test'\n store.value.logLevel = logLevels.debug\n capture = captureWrittenLog()\n })\n afterEach(() => {\n capture.reset()\n })\n test('logger with custom level', async () => {\n addCustomLogLevel('cust_lvl', 100)\n const logger = getLogger<'cust_lvl'>('cust')\n logger.cust_lvl('a', 'b')\n\n a.satisfies(capture.logs, [{ id: 'cust', level: 100, args: ['a', 'b'] }])\n })\n describe('count()', () => {\n test('will increment the counter', async () => {\n const logger = getLogger('inc counter')\n\n logger.count()\n logger.count()\n\n a.satisfies(capture.logs, [\n { id: 'inc counter', level: logLevels.debug, args: [1] },\n { id: 'inc counter', level: logLevels.debug, args: [2] }\n ])\n })\n\n test('append args after the counter', async () => {\n store.value.logLevel = logLevels.debug\n const id = 'inc with args'\n const logger = getLogger(id)\n logger.count('msg1', 'msg2')\n\n a.satisfies(capture.logs, [\n { id, level: logLevels.debug, args: [1, 'msg1', 'msg2'] }\n ])\n })\n\n test('not log if log level is less than debug', async () => {\n store.value.logLevel = logLevels.debug - 1\n const id = 'inc with args'\n const logger = getLogger(id)\n logger.count('msg1', 'msg2')\n\n expect(capture.logs.length).toBe(0)\n })\n })\n\n describe('log level tests', () => {\n beforeEach(() => {\n store.value.mode = 'test'\n store.value.logLevel = logLevels.error\n })\n\n afterEach(() => {\n store.reset()\n })\n\n async function assertLoggedAtLevel(log: any, level: number) {\n setLogLevel(level)\n const msg = `should log on level: ${level}`\n log[log.id](msg)\n a.satisfies(capture.logs, [{ id: log.id, level: toLogLevel(log.id), args: [msg] }])\n }\n\n async function assertNotLoggedAtLevel(log: any, level: number) {\n setLogLevel(level)\n log[log.id](`should not log on level: ${level}`)\n expect(capture.logs.length).toBe(0)\n }\n\n async function assertLoggedAtLocalLevel(log: any, globalLevel: number, localLevel: number) {\n setLogLevel(globalLevel)\n log.level = localLevel\n\n const msg = `should log on level: ${localLevel}`\n log[log.id](msg)\n a.satisfies(capture.logs, [{ id: log.id, level: toLogLevel(log.id), args: [msg] }])\n }\n\n async function assertNotLoggedAtLocalLevel(log: any, globalLevel: number, localLevel: number) {\n setLogLevel(globalLevel)\n log.level = localLevel\n log[log.id](`should not log on level: ${localLevel}`)\n expect(capture.logs.length).toBe(0)\n }\n\n async function assertLogFunctionCalledAtLevel(log: any, callLevel: number, actualLevel: number) {\n setLogLevel(actualLevel)\n let actual = false\n log.on(callLevel, () => actual = true)\n expect(actual).toBe(true)\n }\n\n async function assertLogFunctionCalledAtLocalLevel(log: Logger, callLevel: number, globalLevel: number, localLevel: number) {\n setLogLevel(globalLevel)\n log.level = localLevel\n let actual = false\n log.on(callLevel, () => actual = true)\n expect(actual).toBe(true)\n }\n function assertLogFunctionNotCalledAtLevel(log: any, callLevel: number, actualLevel: number) {\n setLogLevel(actualLevel)\n log.on(callLevel, () => { throw new Error(`should not log at level ${actualLevel}`) })\n }\n\n function assertLogFunctionNotCalledAtLocalLevel(log: any, callLevel: number, globalLevel: number, localLevel: number) {\n setLogLevel(globalLevel)\n log.level = localLevel\n log.on(callLevel, () => { throw new Error(`should not log at local level ${localLevel}`) })\n }\n\n const shouldLog = wrapTest((test) => (method: string, level: number) => {\n const name = toLogLevelName(level)\n test(`${method}() should log on level: ${name} (${level})`, () => {\n const log = getLogger(method)\n\n return assertLoggedAtLevel(log, level)\n })\n })\n\n const shouldNotLog = wrapTest((test) => (method: string, level: number) => {\n const name = toLogLevelName(level)\n test(`${method}() should not log on level: ${name} (${level})`, () => {\n const log = getLogger(method)\n\n return assertNotLoggedAtLevel(log, level)\n })\n })\n\n const shouldLogWithLocalLevelOverride = wrapTest((test) => (method: string, localLevel: number) => {\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const log = getLogger(method)\n\n return assertLoggedAtLocalLevel(log, globalLevel, localLevel)\n })\n })\n })\n\n const shouldNotLogWithLocalLevelOverride = wrapTest((test) => (method: string, localLevel: number) => {\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should not log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const log = getLogger(method)\n\n return assertNotLoggedAtLocalLevel(log, globalLevel, localLevel)\n })\n })\n })\n\n const shouldCallLogFunction = wrapTest((test) => (callLevel: number, actualLevel: number) => {\n const method = toLogLevelName(callLevel)\n const name = toLogLevelName(actualLevel)\n test(`${method}() should call log function on level: ${name} (${actualLevel})`, () => {\n const log = getLogger(method)\n\n return assertLogFunctionCalledAtLevel(log, callLevel, actualLevel)\n })\n })\n\n const shouldNotCallLogFunction = wrapTest((test) => (callLevel: number, actualLevel: number) => {\n const method = toLogLevelName(callLevel)\n const name = toLogLevelName(actualLevel)\n test(`${method}() should not call log function on level: ${name} (${actualLevel})`, () => {\n const log = getLogger(method)\n\n assertLogFunctionNotCalledAtLevel(log, callLevel, actualLevel)\n })\n })\n\n const shouldCallLogFunctionWithLocalLevelOverride = wrapTest((test) => (callLevel: number, localLevel: number) => {\n const method = toLogLevelName(callLevel)\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const log = getLogger(method)\n\n return assertLogFunctionCalledAtLocalLevel(log, callLevel, globalLevel, localLevel)\n })\n })\n })\n\n const shouldNotCallLogFunctionWithLocalLevelOverride = wrapTest((test) => (callLevel: number, localLevel: number) => {\n const method = toLogLevelName(callLevel)\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should not log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const log = getLogger(method)\n\n assertLogFunctionNotCalledAtLocalLevel(log, callLevel, globalLevel, localLevel)\n })\n })\n })\n\n function wrapTest<F>(fn: (test: jest.It) => F) {\n return Object.assign(fn(test), { only: fn(test.only), skip: fn(test.skip) })\n }\n\n shouldNotLog('error', logLevels.none)\n shouldLog('error', logLevels.error)\n shouldLog('error', logLevels.warn)\n shouldLog('error', logLevels.info)\n shouldLog('error', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('error', logLevels.none)\n shouldLogWithLocalLevelOverride('error', logLevels.error)\n shouldLogWithLocalLevelOverride('error', logLevels.warn)\n shouldLogWithLocalLevelOverride('error', logLevels.info)\n shouldLogWithLocalLevelOverride('error', logLevels.debug)\n\n shouldNotLog('warn', logLevels.none)\n shouldNotLog('warn', logLevels.error)\n shouldLog('warn', logLevels.warn)\n shouldLog('warn', logLevels.info)\n shouldLog('warn', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('warn', logLevels.none)\n shouldNotLogWithLocalLevelOverride('warn', logLevels.error)\n shouldLogWithLocalLevelOverride('warn', logLevels.warn)\n shouldLogWithLocalLevelOverride('warn', logLevels.info)\n shouldLogWithLocalLevelOverride('warn', logLevels.debug)\n\n shouldNotLog('info', logLevels.none)\n shouldNotLog('info', logLevels.error)\n shouldNotLog('info', logLevels.warn)\n shouldLog('info', logLevels.info)\n shouldLog('info', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('info', logLevels.none)\n shouldNotLogWithLocalLevelOverride('info', logLevels.error)\n shouldNotLogWithLocalLevelOverride('info', logLevels.warn)\n shouldLogWithLocalLevelOverride('info', logLevels.info)\n shouldLogWithLocalLevelOverride('info', logLevels.debug)\n\n shouldNotLog('debug', logLevels.none)\n shouldNotLog('debug', logLevels.error)\n shouldNotLog('debug', logLevels.warn)\n shouldNotLog('debug', logLevels.info)\n shouldLog('debug', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.none)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.error)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.warn)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.info)\n shouldLogWithLocalLevelOverride('debug', logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.error, logLevels.none)\n shouldCallLogFunction(logLevels.error, logLevels.error)\n shouldCallLogFunction(logLevels.error, logLevels.warn)\n shouldCallLogFunction(logLevels.error, logLevels.info)\n shouldCallLogFunction(logLevels.error, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.none)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.error)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.warn)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.warn, logLevels.none)\n shouldNotCallLogFunction(logLevels.warn, logLevels.error)\n shouldCallLogFunction(logLevels.warn, logLevels.warn)\n shouldCallLogFunction(logLevels.warn, logLevels.info)\n shouldCallLogFunction(logLevels.warn, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.none)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.error)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.warn)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.info, logLevels.none)\n shouldNotCallLogFunction(logLevels.info, logLevels.error)\n shouldNotCallLogFunction(logLevels.info, logLevels.warn)\n shouldCallLogFunction(logLevels.info, logLevels.info)\n shouldCallLogFunction(logLevels.info, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.none)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.error)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.warn)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.debug, logLevels.none)\n shouldNotCallLogFunction(logLevels.debug, logLevels.error)\n shouldNotCallLogFunction(logLevels.debug, logLevels.warn)\n shouldNotCallLogFunction(logLevels.debug, logLevels.info)\n shouldCallLogFunction(logLevels.debug, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.none)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.error)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.warn)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.debug)\n })\n\n test('on() log using log argument', () => {\n store.value.mode = 'test'\n store.value.logLevel = logLevels.debug\n const logger = getLogger('log on fn')\n\n logger.on('error', log => { log('value') })\n\n a.satisfies(capture.logs, [\n { id: 'log on fn', level: logLevels.error, args: ['value'] }\n ])\n })\n\n test('write entry directly', () => {\n const log = getLogger('write-entry')\n const entry = { id: 'write-entry', level: logLevels.info, args: ['abc'], timestamp: new Date() }\n log.write(entry)\n a.satisfies(capture.logs, [entry])\n })\n})\n\ntest('on() can take log level name in first argument', () => {\n const log = getLogger('string-on')\n log.on('debug', () => { return })\n})\n\ntest('auto configure', async () => {\n expect(store.value.configured).toBeFalsy()\n const log = getLogger('auto config')\n\n log.info('config is called automatically as expected')\n\n await delay(10)\n expect(store.value.configured).toBeTruthy()\n})\n\ndescribe('writeTo', () => {\n let memReporter: MemoryLogReporter\n let specialReporter: MemoryLogReporter\n beforeEach(() => {\n memReporter = createMemoryLogReporter()\n specialReporter = createMemoryLogReporter({ id: 'special' })\n config({ mode: 'test', reporters: [memReporter, specialReporter] })\n })\n test('specific reporter with string', () => {\n const log = getLogger('writeTo-string', { writeTo: 'special' })\n log.error('error message')\n\n expect(memReporter.logs.length).toEqual(0)\n expect(specialReporter.logs.length).toEqual(1)\n })\n\n test('specific reporter with regex', () => {\n const log = getLogger('writeTo-regex', { writeTo: /^spec/ })\n log.error('error message')\n\n expect(memReporter.logs.length).toEqual(0)\n expect(specialReporter.logs.length).toEqual(1)\n })\n\n test('specific reporter with RegExp', () => {\n const log = getLogger('writeTo-RegExp', { writeTo: new RegExp('^spec') })\n log.error('error message')\n\n expect(memReporter.logs.length).toEqual(0)\n expect(specialReporter.logs.length).toEqual(1)\n })\n\n test('specific reporter with function', () => {\n const log = getLogger('writeTo-fn', { writeTo: id => id === 'special' })\n log.error('error message')\n\n expect(memReporter.logs.length).toEqual(0)\n expect(specialReporter.logs.length).toEqual(1)\n })\n\n test('custom reporter', () => {\n const reporter = createMemoryLogReporter({ id: 'custom mem' })\n const log = getLogger('writeTo-reporter', { writeTo: reporter })\n log.error('error message')\n\n expect(reporter.logs.length).toEqual(1)\n })\n\n test('custom reporter cannot override added console reporter', () => {\n // if not, it would be a security issue as the new reporter\n // can capture the logs from other logger and send it elsewhere\n const reporter = createMemoryLogReporter({ id: 'custom mem' })\n reporter.isConsoleReporter = true\n getLogger('writeTo-reporter-no-override', { writeTo: reporter })\n const log = getLogger('writeTo-reporter-no-override-2')\n log.error('error message')\n\n expect(reporter.logs.length).toEqual(0)\n })\n})\n\ntest('id is readonly', () => {\n const log: any = getLogger('id is readonly')\n a.throws(() => log.id = 'b')\n})\n\ntest.each(['on', 'count', 'error', 'warn', 'info', 'debug'])('method %s is readonly', name => {\n const log: any = getLogger(`${name} is readonly`)\n\n a.throws(() => log[name] = true)\n})\n\n"]}
|
package/cjs/getLoggers.d.ts
DELETED
package/cjs/getLoggers.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLoggers.d.ts","sourceRoot":"","sources":["../ts/getLoggers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAGxD"}
|
package/cjs/getLoggers.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLoggers = void 0;
|
|
4
|
-
var type_plus_1 = require("type-plus");
|
|
5
|
-
var store_js_1 = require("./store.js");
|
|
6
|
-
/**
|
|
7
|
-
* Get loggers based on RegExp.
|
|
8
|
-
* @param filter RegExp to look for loggers
|
|
9
|
-
*/
|
|
10
|
-
function getLoggers(filter) {
|
|
11
|
-
var loggerClosures = store_js_1.store.value.loggerClosures;
|
|
12
|
-
return (0, type_plus_1.filterKey)(loggerClosures, function (id) { return filter.test(id); }).map(function (k) { return loggerClosures[k].logger; });
|
|
13
|
-
}
|
|
14
|
-
exports.getLoggers = getLoggers;
|
|
15
|
-
//# sourceMappingURL=getLoggers.js.map
|
package/cjs/getLoggers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLoggers.js","sourceRoot":"","sources":["../ts/getLoggers.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,uCAAkC;AAGlC;;;GAGG;AACH,SAAgB,UAAU,CAAC,MAAc;IAC/B,IAAA,cAAc,GAAK,gBAAK,CAAC,KAAK,eAAhB,CAAgB;IACtC,OAAO,IAAA,qBAAS,EAAC,cAAc,EAAE,UAAA,EAAE,IAAI,OAAA,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAf,CAAe,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,EAAxB,CAAwB,CAAC,CAAA;AAC5F,CAAC;AAHD,gCAGC","sourcesContent":["import { filterKey } from 'type-plus'\nimport { store } from './store.js'\nimport { Logger } from './types.js'\n\n/**\n * Get loggers based on RegExp.\n * @param filter RegExp to look for loggers\n */\nexport function getLoggers(filter: RegExp): Logger<any>[] {\n const { loggerClosures } = store.value\n return filterKey(loggerClosures, id => filter.test(id)).map(k => loggerClosures[k].logger)\n}\n"]}
|