standard-log 7.0.2 → 8.0.0
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/LICENSE +1 -1
- package/README.md +14 -1
- package/{lib → cjs}/LogEntry.d.ts +0 -0
- package/cjs/LogEntry.d.ts.map +1 -0
- package/{lib → cjs}/LogEntry.js +0 -0
- package/cjs/LogEntry.js.map +1 -0
- package/cjs/captureLogs.d.ts +4 -0
- package/cjs/captureLogs.d.ts.map +1 -0
- package/cjs/captureLogs.js +33 -0
- package/cjs/captureLogs.js.map +1 -0
- package/cjs/captureLogs.spec.d.ts +2 -0
- package/cjs/captureLogs.spec.d.ts.map +1 -0
- package/cjs/captureLogs.spec.js +117 -0
- package/cjs/captureLogs.spec.js.map +1 -0
- package/cjs/config.d.ts +12 -0
- package/cjs/config.d.ts.map +1 -0
- package/cjs/config.js +59 -0
- package/cjs/config.js.map +1 -0
- package/cjs/config.spec.d.ts +2 -0
- package/cjs/config.spec.d.ts.map +1 -0
- package/cjs/config.spec.js +66 -0
- package/cjs/config.spec.js.map +1 -0
- package/cjs/configForTest.d.ts +5 -0
- package/cjs/configForTest.d.ts.map +1 -0
- package/cjs/configForTest.js +18 -0
- package/cjs/configForTest.js.map +1 -0
- package/cjs/configForTest.spec.d.ts +2 -0
- package/cjs/configForTest.spec.d.ts.map +1 -0
- package/cjs/configForTest.spec.js +17 -0
- package/cjs/configForTest.spec.js.map +1 -0
- package/cjs/console/createConsoleLogReporter.d.ts +9 -0
- package/cjs/console/createConsoleLogReporter.d.ts.map +1 -0
- package/cjs/console/createConsoleLogReporter.js +42 -0
- package/cjs/console/createConsoleLogReporter.js.map +1 -0
- package/cjs/console/createConsoleLogReporter.spec.d.ts +2 -0
- package/cjs/console/createConsoleLogReporter.spec.d.ts.map +1 -0
- package/cjs/console/createConsoleLogReporter.spec.js +182 -0
- package/cjs/console/createConsoleLogReporter.spec.js.map +1 -0
- package/cjs/console/index.d.ts +4 -0
- package/cjs/console/index.d.ts.map +1 -0
- package/cjs/console/index.js +20 -0
- package/cjs/console/index.js.map +1 -0
- package/{lib → cjs}/console/isConsoleDebugAvailable.d.ts +0 -0
- package/cjs/console/isConsoleDebugAvailable.d.ts.map +1 -0
- package/cjs/console/isConsoleDebugAvailable.js +20 -0
- package/cjs/console/isConsoleDebugAvailable.js.map +1 -0
- package/{lib → cjs}/console/polyfilledConsole.d.ts +0 -0
- package/cjs/console/polyfilledConsole.d.ts.map +1 -0
- package/cjs/console/polyfilledConsole.js +41 -0
- package/cjs/console/polyfilledConsole.js.map +1 -0
- package/{lib → cjs}/console/semverGt.d.ts +0 -0
- package/cjs/console/semverGt.d.ts.map +1 -0
- package/{lib → cjs}/console/semverGt.js +0 -0
- package/cjs/console/semverGt.js.map +1 -0
- package/cjs/console/semverGt.spec.d.ts +2 -0
- package/cjs/console/semverGt.spec.d.ts.map +1 -0
- package/cjs/console/semverGt.spec.js +22 -0
- package/cjs/console/semverGt.spec.js.map +1 -0
- package/{lib → cjs}/console/toConsoleMethod.d.ts +0 -0
- package/cjs/console/toConsoleMethod.d.ts.map +1 -0
- package/cjs/console/toConsoleMethod.js +22 -0
- package/cjs/console/toConsoleMethod.js.map +1 -0
- package/cjs/console/types.d.ts +3 -0
- package/cjs/console/types.d.ts.map +1 -0
- package/{lib → cjs}/console/types.js +0 -0
- package/cjs/console/types.js.map +1 -0
- package/cjs/customLogLevel.d.ts +11 -0
- package/cjs/customLogLevel.d.ts.map +1 -0
- package/cjs/customLogLevel.js +38 -0
- package/cjs/customLogLevel.js.map +1 -0
- package/cjs/customLogLevel.spec.d.ts +2 -0
- package/cjs/customLogLevel.spec.d.ts.map +1 -0
- package/cjs/customLogLevel.spec.js +37 -0
- package/cjs/customLogLevel.spec.js.map +1 -0
- package/{lib → cjs}/errors.d.ts +0 -0
- package/cjs/errors.d.ts.map +1 -0
- package/cjs/errors.js +85 -0
- package/cjs/errors.js.map +1 -0
- package/{lib → cjs}/formatter/createTimestampFormatter.d.ts +0 -0
- package/cjs/formatter/createTimestampFormatter.d.ts.map +1 -0
- package/cjs/formatter/createTimestampFormatter.js +26 -0
- package/cjs/formatter/createTimestampFormatter.js.map +1 -0
- package/cjs/formatter/createTimestampFormatter.spec.d.ts +2 -0
- package/cjs/formatter/createTimestampFormatter.spec.d.ts.map +1 -0
- package/cjs/formatter/createTimestampFormatter.spec.js +23 -0
- package/cjs/formatter/createTimestampFormatter.spec.js.map +1 -0
- package/{lib → cjs}/formatter/formatLogLevel.d.ts +0 -0
- package/cjs/formatter/formatLogLevel.d.ts.map +1 -0
- package/cjs/formatter/formatLogLevel.js +10 -0
- package/cjs/formatter/formatLogLevel.js.map +1 -0
- package/cjs/formatter/index.d.ts +4 -0
- package/cjs/formatter/index.d.ts.map +1 -0
- package/cjs/formatter/index.js +20 -0
- package/cjs/formatter/index.js.map +1 -0
- package/cjs/formatter/plainLogFormatter.d.ts +3 -0
- package/cjs/formatter/plainLogFormatter.d.ts.map +1 -0
- package/cjs/formatter/plainLogFormatter.js +19 -0
- package/cjs/formatter/plainLogFormatter.js.map +1 -0
- package/cjs/formatter/plainLogFormatter.spec.d.ts +2 -0
- package/cjs/formatter/plainLogFormatter.spec.d.ts.map +1 -0
- package/cjs/formatter/plainLogFormatter.spec.js +9 -0
- package/cjs/formatter/plainLogFormatter.spec.js.map +1 -0
- package/{lib → cjs}/getDefaultReporter.browser.d.ts +0 -0
- package/cjs/getDefaultReporter.browser.d.ts.map +1 -0
- package/cjs/getDefaultReporter.browser.js +15 -0
- package/cjs/getDefaultReporter.browser.js.map +1 -0
- package/{lib → cjs}/getDefaultReporter.d.ts +0 -0
- package/cjs/getDefaultReporter.d.ts.map +1 -0
- package/cjs/getDefaultReporter.js +19 -0
- package/cjs/getDefaultReporter.js.map +1 -0
- package/cjs/getLogModeFromEnvironment.browser.d.ts +3 -0
- package/cjs/getLogModeFromEnvironment.browser.d.ts.map +1 -0
- package/{lib → cjs}/getLogModeFromEnvironment.browser.js +0 -0
- package/cjs/getLogModeFromEnvironment.browser.js.map +1 -0
- package/cjs/getLogModeFromEnvironment.d.ts +3 -0
- package/cjs/getLogModeFromEnvironment.d.ts.map +1 -0
- package/cjs/getLogModeFromEnvironment.js +17 -0
- package/cjs/getLogModeFromEnvironment.js.map +1 -0
- package/cjs/getLogModeFromEnvironment.spec.d.ts +2 -0
- package/cjs/getLogModeFromEnvironment.spec.d.ts.map +1 -0
- package/cjs/getLogModeFromEnvironment.spec.js +19 -0
- package/cjs/getLogModeFromEnvironment.spec.js.map +1 -0
- package/cjs/getLogger.d.ts +9 -0
- package/cjs/getLogger.d.ts.map +1 -0
- package/cjs/getLogger.js +103 -0
- package/cjs/getLogger.js.map +1 -0
- package/cjs/getLogger.spec.d.ts +2 -0
- package/cjs/getLogger.spec.d.ts.map +1 -0
- package/cjs/getLogger.spec.js +481 -0
- package/cjs/getLogger.spec.js.map +1 -0
- package/cjs/getLoggers.d.ts +7 -0
- package/cjs/getLoggers.d.ts.map +1 -0
- package/cjs/getLoggers.js +15 -0
- package/cjs/getLoggers.js.map +1 -0
- package/cjs/index.d.ts +17 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +33 -0
- package/cjs/index.js.map +1 -0
- package/{lib → cjs}/logLevel.d.ts +0 -0
- package/cjs/logLevel.d.ts.map +1 -0
- package/{lib → cjs}/logLevel.js +0 -0
- package/cjs/logLevel.js.map +1 -0
- package/cjs/logLevel.spec.d.ts +2 -0
- package/cjs/logLevel.spec.d.ts.map +1 -0
- package/cjs/logLevel.spec.js +195 -0
- package/cjs/logLevel.spec.js.map +1 -0
- package/cjs/logLevelFn.d.ts +20 -0
- package/cjs/logLevelFn.d.ts.map +1 -0
- package/cjs/logLevelFn.js +76 -0
- package/cjs/logLevelFn.js.map +1 -0
- package/cjs/logReporter.d.ts +7 -0
- package/cjs/logReporter.d.ts.map +1 -0
- package/cjs/logReporter.js +29 -0
- package/cjs/logReporter.js.map +1 -0
- package/cjs/logReporter.spec.d.ts +2 -0
- package/cjs/logReporter.spec.d.ts.map +1 -0
- package/cjs/logReporter.spec.js +86 -0
- package/cjs/logReporter.spec.js.map +1 -0
- package/cjs/logReporterInternal.d.ts +3 -0
- package/cjs/logReporterInternal.d.ts.map +1 -0
- package/cjs/logReporterInternal.js +23 -0
- package/cjs/logReporterInternal.js.map +1 -0
- package/cjs/memory/MemoryLogReporter.d.ts +14 -0
- package/cjs/memory/MemoryLogReporter.d.ts.map +1 -0
- package/cjs/memory/MemoryLogReporter.js +56 -0
- package/cjs/memory/MemoryLogReporter.js.map +1 -0
- package/cjs/memory/MemoryLogReporter.spec.d.ts +2 -0
- package/cjs/memory/MemoryLogReporter.spec.d.ts.map +1 -0
- package/cjs/memory/MemoryLogReporter.spec.js +111 -0
- package/cjs/memory/MemoryLogReporter.spec.js.map +1 -0
- package/cjs/memory/index.d.ts +3 -0
- package/cjs/memory/index.d.ts.map +1 -0
- package/cjs/memory/index.js +19 -0
- package/cjs/memory/index.js.map +1 -0
- package/cjs/memory/logEntriesToString.d.ts +3 -0
- package/cjs/memory/logEntriesToString.d.ts.map +1 -0
- package/cjs/memory/logEntriesToString.js +10 -0
- package/cjs/memory/logEntriesToString.js.map +1 -0
- package/cjs/memory/logEntriesToString.spec.d.ts +2 -0
- package/cjs/memory/logEntriesToString.spec.d.ts.map +1 -0
- package/cjs/memory/logEntriesToString.spec.js +36 -0
- package/cjs/memory/logEntriesToString.spec.js.map +1 -0
- package/cjs/memory/toInspectStringForObject.d.ts +3 -0
- package/cjs/memory/toInspectStringForObject.d.ts.map +1 -0
- package/cjs/memory/toInspectStringForObject.js +17 -0
- package/cjs/memory/toInspectStringForObject.js.map +1 -0
- package/cjs/package.json +3 -0
- package/cjs/shouldLog.d.ts +8 -0
- package/cjs/shouldLog.d.ts.map +1 -0
- package/cjs/shouldLog.js +14 -0
- package/cjs/shouldLog.js.map +1 -0
- package/cjs/store.d.ts +3 -0
- package/cjs/store.d.ts.map +1 -0
- package/cjs/store.js +27 -0
- package/cjs/store.js.map +1 -0
- package/cjs/suppressLogs.d.ts +6 -0
- package/cjs/suppressLogs.d.ts.map +1 -0
- package/cjs/suppressLogs.js +17 -0
- package/cjs/suppressLogs.js.map +1 -0
- package/cjs/suppressLogs.spec.d.ts +2 -0
- package/cjs/suppressLogs.spec.d.ts.map +1 -0
- package/cjs/suppressLogs.spec.js +31 -0
- package/cjs/suppressLogs.spec.js.map +1 -0
- package/cjs/testUtil.d.ts +7 -0
- package/cjs/testUtil.d.ts.map +1 -0
- package/cjs/testUtil.js +25 -0
- package/cjs/testUtil.js.map +1 -0
- package/{lib → cjs}/types.d.ts +0 -0
- package/cjs/types.d.ts.map +1 -0
- package/{lib → cjs}/types.js +0 -0
- package/cjs/types.js.map +1 -0
- package/cjs/types.spec.d.ts +2 -0
- package/cjs/types.spec.d.ts.map +1 -0
- package/cjs/types.spec.js +7 -0
- package/cjs/types.spec.js.map +1 -0
- package/cjs/typesInternal.d.ts +20 -0
- package/cjs/typesInternal.d.ts.map +1 -0
- package/{lib → cjs}/typesInternal.js +0 -0
- package/cjs/typesInternal.js.map +1 -0
- package/{lib → cjs}/utils.d.ts +0 -0
- package/cjs/utils.d.ts.map +1 -0
- package/cjs/utils.js +14 -0
- package/cjs/utils.js.map +1 -0
- package/cjs/writeToReporters.d.ts +6 -0
- package/cjs/writeToReporters.d.ts.map +1 -0
- package/cjs/writeToReporters.js +22 -0
- package/cjs/writeToReporters.js.map +1 -0
- package/cjs/writeToReporters.spec.d.ts +2 -0
- package/cjs/writeToReporters.spec.d.ts.map +1 -0
- package/cjs/writeToReporters.spec.js +59 -0
- package/cjs/writeToReporters.spec.js.map +1 -0
- package/dist/standard-log.es5.js +2724 -0
- package/dist/standard-log.es5.js.gz +0 -0
- package/dist/standard-log.es5.js.map +1 -0
- package/dist/standard-log.es5.js.map.gz +0 -0
- package/dist/standard-log.esm.js +2724 -0
- package/dist/standard-log.esm.js.gz +0 -0
- package/dist/standard-log.esm.js.map +1 -0
- package/dist/standard-log.esm.js.map.gz +0 -0
- package/{libm → esm}/LogEntry.d.ts +0 -0
- package/esm/LogEntry.d.ts.map +1 -0
- package/{libm → esm}/LogEntry.js +0 -0
- package/esm/LogEntry.js.map +1 -0
- package/esm/captureLogs.d.ts +4 -0
- package/esm/captureLogs.d.ts.map +1 -0
- package/esm/captureLogs.js +29 -0
- package/esm/captureLogs.js.map +1 -0
- package/esm/captureLogs.spec.d.ts +2 -0
- package/esm/captureLogs.spec.d.ts.map +1 -0
- package/esm/captureLogs.spec.js +45 -0
- package/esm/captureLogs.spec.js.map +1 -0
- package/esm/config.d.ts +12 -0
- package/esm/config.d.ts.map +1 -0
- package/esm/config.js +44 -0
- package/esm/config.js.map +1 -0
- package/esm/config.spec.d.ts +2 -0
- package/esm/config.spec.d.ts.map +1 -0
- package/esm/config.spec.js +61 -0
- package/esm/config.spec.js.map +1 -0
- package/esm/configForTest.d.ts +5 -0
- package/esm/configForTest.d.ts.map +1 -0
- package/esm/configForTest.js +14 -0
- package/esm/configForTest.js.map +1 -0
- package/esm/configForTest.spec.d.ts +2 -0
- package/esm/configForTest.spec.d.ts.map +1 -0
- package/esm/configForTest.spec.js +15 -0
- package/esm/configForTest.spec.js.map +1 -0
- package/esm/console/createConsoleLogReporter.d.ts +9 -0
- package/esm/console/createConsoleLogReporter.d.ts.map +1 -0
- package/esm/console/createConsoleLogReporter.js +37 -0
- package/esm/console/createConsoleLogReporter.js.map +1 -0
- package/esm/console/createConsoleLogReporter.spec.d.ts +2 -0
- package/esm/console/createConsoleLogReporter.spec.d.ts.map +1 -0
- package/esm/console/createConsoleLogReporter.spec.js +153 -0
- package/esm/console/createConsoleLogReporter.spec.js.map +1 -0
- package/esm/console/index.d.ts +4 -0
- package/esm/console/index.d.ts.map +1 -0
- package/esm/console/index.js +4 -0
- package/esm/console/index.js.map +1 -0
- package/{libm → esm}/console/isConsoleDebugAvailable.d.ts +0 -0
- package/esm/console/isConsoleDebugAvailable.d.ts.map +1 -0
- package/esm/console/isConsoleDebugAvailable.js +13 -0
- package/esm/console/isConsoleDebugAvailable.js.map +1 -0
- package/{libm → esm}/console/polyfilledConsole.d.ts +0 -0
- package/esm/console/polyfilledConsole.d.ts.map +1 -0
- package/esm/console/polyfilledConsole.js +32 -0
- package/esm/console/polyfilledConsole.js.map +1 -0
- package/{libm → esm}/console/semverGt.d.ts +0 -0
- package/esm/console/semverGt.d.ts.map +1 -0
- package/{libm → esm}/console/semverGt.js +0 -0
- package/esm/console/semverGt.js.map +1 -0
- package/esm/console/semverGt.spec.d.ts +2 -0
- package/esm/console/semverGt.spec.d.ts.map +1 -0
- package/esm/console/semverGt.spec.js +20 -0
- package/esm/console/semverGt.spec.js.map +1 -0
- package/{libm → esm}/console/toConsoleMethod.d.ts +0 -0
- package/esm/console/toConsoleMethod.d.ts.map +1 -0
- package/esm/console/toConsoleMethod.js +18 -0
- package/esm/console/toConsoleMethod.js.map +1 -0
- package/esm/console/types.d.ts +3 -0
- package/esm/console/types.d.ts.map +1 -0
- package/{libm → esm}/console/types.js +0 -0
- package/esm/console/types.js.map +1 -0
- package/esm/customLogLevel.d.ts +11 -0
- package/esm/customLogLevel.d.ts.map +1 -0
- package/esm/customLogLevel.js +30 -0
- package/esm/customLogLevel.js.map +1 -0
- package/esm/customLogLevel.spec.d.ts +2 -0
- package/esm/customLogLevel.spec.d.ts.map +1 -0
- package/esm/customLogLevel.spec.js +32 -0
- package/esm/customLogLevel.spec.js.map +1 -0
- package/{libm → esm}/errors.d.ts +0 -0
- package/esm/errors.d.ts.map +1 -0
- package/esm/errors.js +52 -0
- package/esm/errors.js.map +1 -0
- package/{libm → esm}/formatter/createTimestampFormatter.d.ts +0 -0
- package/esm/formatter/createTimestampFormatter.d.ts.map +1 -0
- package/{libm → esm}/formatter/createTimestampFormatter.js +0 -0
- package/esm/formatter/createTimestampFormatter.js.map +1 -0
- package/esm/formatter/createTimestampFormatter.spec.d.ts +2 -0
- package/esm/formatter/createTimestampFormatter.spec.d.ts.map +1 -0
- package/esm/formatter/createTimestampFormatter.spec.js +21 -0
- package/esm/formatter/createTimestampFormatter.spec.js.map +1 -0
- package/{libm → esm}/formatter/formatLogLevel.d.ts +0 -0
- package/esm/formatter/formatLogLevel.d.ts.map +1 -0
- package/esm/formatter/formatLogLevel.js +6 -0
- package/esm/formatter/formatLogLevel.js.map +1 -0
- package/esm/formatter/index.d.ts +4 -0
- package/esm/formatter/index.d.ts.map +1 -0
- package/esm/formatter/index.js +4 -0
- package/esm/formatter/index.js.map +1 -0
- package/esm/formatter/plainLogFormatter.d.ts +3 -0
- package/esm/formatter/plainLogFormatter.d.ts.map +1 -0
- package/esm/formatter/plainLogFormatter.js +5 -0
- package/esm/formatter/plainLogFormatter.js.map +1 -0
- package/esm/formatter/plainLogFormatter.spec.d.ts +2 -0
- package/esm/formatter/plainLogFormatter.spec.d.ts.map +1 -0
- package/esm/formatter/plainLogFormatter.spec.js +7 -0
- package/esm/formatter/plainLogFormatter.spec.js.map +1 -0
- package/{libm → esm}/getDefaultReporter.browser.d.ts +0 -0
- package/esm/getDefaultReporter.browser.d.ts.map +1 -0
- package/esm/getDefaultReporter.browser.js +11 -0
- package/esm/getDefaultReporter.browser.js.map +1 -0
- package/{libm → esm}/getDefaultReporter.d.ts +0 -0
- package/esm/getDefaultReporter.d.ts.map +1 -0
- package/esm/getDefaultReporter.js +15 -0
- package/esm/getDefaultReporter.js.map +1 -0
- package/esm/getLogModeFromEnvironment.browser.d.ts +3 -0
- package/esm/getLogModeFromEnvironment.browser.d.ts.map +1 -0
- package/{libm → esm}/getLogModeFromEnvironment.browser.js +0 -0
- package/esm/getLogModeFromEnvironment.browser.js.map +1 -0
- package/esm/getLogModeFromEnvironment.d.ts +3 -0
- package/esm/getLogModeFromEnvironment.d.ts.map +1 -0
- package/esm/getLogModeFromEnvironment.js +13 -0
- package/esm/getLogModeFromEnvironment.js.map +1 -0
- package/esm/getLogModeFromEnvironment.spec.d.ts +2 -0
- package/esm/getLogModeFromEnvironment.spec.d.ts.map +1 -0
- package/esm/getLogModeFromEnvironment.spec.js +14 -0
- package/esm/getLogModeFromEnvironment.spec.js.map +1 -0
- package/esm/getLogger.d.ts +9 -0
- package/esm/getLogger.d.ts.map +1 -0
- package/esm/getLogger.js +78 -0
- package/esm/getLogger.js.map +1 -0
- package/esm/getLogger.spec.d.ts +2 -0
- package/esm/getLogger.spec.d.ts.map +1 -0
- package/esm/getLogger.spec.js +381 -0
- package/esm/getLogger.spec.js.map +1 -0
- package/esm/getLoggers.d.ts +7 -0
- package/esm/getLoggers.d.ts.map +1 -0
- package/esm/getLoggers.js +11 -0
- package/esm/getLoggers.js.map +1 -0
- package/esm/index.d.ts +17 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +17 -0
- package/esm/index.js.map +1 -0
- package/{libm → esm}/logLevel.d.ts +0 -0
- package/esm/logLevel.d.ts.map +1 -0
- package/{libm → esm}/logLevel.js +0 -0
- package/esm/logLevel.js.map +1 -0
- package/esm/logLevel.spec.d.ts +2 -0
- package/esm/logLevel.spec.d.ts.map +1 -0
- package/esm/logLevel.spec.js +148 -0
- package/esm/logLevel.spec.js.map +1 -0
- package/esm/logLevelFn.d.ts +20 -0
- package/esm/logLevelFn.d.ts.map +1 -0
- package/esm/logLevelFn.js +67 -0
- package/esm/logLevelFn.js.map +1 -0
- package/esm/logReporter.d.ts +7 -0
- package/esm/logReporter.d.ts.map +1 -0
- package/esm/logReporter.js +21 -0
- package/esm/logReporter.js.map +1 -0
- package/esm/logReporter.spec.d.ts +2 -0
- package/esm/logReporter.spec.d.ts.map +1 -0
- package/esm/logReporter.spec.js +81 -0
- package/esm/logReporter.spec.js.map +1 -0
- package/esm/logReporterInternal.d.ts +3 -0
- package/esm/logReporterInternal.d.ts.map +1 -0
- package/esm/logReporterInternal.js +19 -0
- package/esm/logReporterInternal.js.map +1 -0
- package/esm/memory/MemoryLogReporter.d.ts +14 -0
- package/esm/memory/MemoryLogReporter.d.ts.map +1 -0
- package/esm/memory/MemoryLogReporter.js +51 -0
- package/esm/memory/MemoryLogReporter.js.map +1 -0
- package/esm/memory/MemoryLogReporter.spec.d.ts +2 -0
- package/esm/memory/MemoryLogReporter.spec.d.ts.map +1 -0
- package/esm/memory/MemoryLogReporter.spec.js +98 -0
- package/esm/memory/MemoryLogReporter.spec.js.map +1 -0
- package/esm/memory/index.d.ts +3 -0
- package/esm/memory/index.d.ts.map +1 -0
- package/esm/memory/index.js +3 -0
- package/esm/memory/index.js.map +1 -0
- package/esm/memory/logEntriesToString.d.ts +3 -0
- package/esm/memory/logEntriesToString.d.ts.map +1 -0
- package/esm/memory/logEntriesToString.js +6 -0
- package/esm/memory/logEntriesToString.js.map +1 -0
- package/esm/memory/logEntriesToString.spec.d.ts +2 -0
- package/esm/memory/logEntriesToString.spec.d.ts.map +1 -0
- package/esm/memory/logEntriesToString.spec.js +42 -0
- package/esm/memory/logEntriesToString.spec.js.map +1 -0
- package/esm/memory/toInspectStringForObject.d.ts +3 -0
- package/esm/memory/toInspectStringForObject.d.ts.map +1 -0
- package/{libm → esm}/memory/toInspectStringForObject.js +0 -0
- package/esm/memory/toInspectStringForObject.js.map +1 -0
- package/esm/shouldLog.d.ts +8 -0
- package/esm/shouldLog.d.ts.map +1 -0
- package/esm/shouldLog.js +10 -0
- package/esm/shouldLog.js.map +1 -0
- package/esm/store.d.ts +3 -0
- package/esm/store.d.ts.map +1 -0
- package/esm/store.js +24 -0
- package/esm/store.js.map +1 -0
- package/esm/suppressLogs.d.ts +6 -0
- package/esm/suppressLogs.d.ts.map +1 -0
- package/esm/suppressLogs.js +9 -0
- package/esm/suppressLogs.js.map +1 -0
- package/esm/suppressLogs.spec.d.ts +2 -0
- package/esm/suppressLogs.spec.d.ts.map +1 -0
- package/esm/suppressLogs.spec.js +29 -0
- package/esm/suppressLogs.spec.js.map +1 -0
- package/esm/testUtil.d.ts +7 -0
- package/esm/testUtil.d.ts.map +1 -0
- package/esm/testUtil.js +17 -0
- package/esm/testUtil.js.map +1 -0
- package/{libm → esm}/types.d.ts +0 -0
- package/esm/types.d.ts.map +1 -0
- package/{libm → esm}/types.js +0 -0
- package/esm/types.js.map +1 -0
- package/esm/types.spec.d.ts +2 -0
- package/esm/types.spec.d.ts.map +1 -0
- package/esm/types.spec.js +5 -0
- package/esm/types.spec.js.map +1 -0
- package/esm/typesInternal.d.ts +20 -0
- package/esm/typesInternal.d.ts.map +1 -0
- package/{libm → esm}/typesInternal.js +0 -0
- package/esm/typesInternal.js.map +1 -0
- package/{libm → esm}/utils.d.ts +0 -0
- package/esm/utils.d.ts.map +1 -0
- package/esm/utils.js +10 -0
- package/esm/utils.js.map +1 -0
- package/esm/writeToReporters.d.ts +6 -0
- package/esm/writeToReporters.d.ts.map +1 -0
- package/esm/writeToReporters.js +18 -0
- package/esm/writeToReporters.js.map +1 -0
- package/esm/writeToReporters.spec.d.ts +2 -0
- package/esm/writeToReporters.spec.d.ts.map +1 -0
- package/esm/writeToReporters.spec.js +9 -0
- package/esm/writeToReporters.spec.js.map +1 -0
- package/package.json +79 -29
- package/{src → ts}/LogEntry.ts +0 -0
- package/ts/captureLogs.ts +35 -0
- package/ts/config.ts +57 -0
- package/ts/configForTest.ts +16 -0
- package/ts/console/createConsoleLogReporter.ts +42 -0
- package/ts/console/index.ts +3 -0
- package/ts/console/isConsoleDebugAvailable.ts +11 -0
- package/ts/console/polyfilledConsole.ts +34 -0
- package/{src → ts}/console/semverGt.ts +0 -0
- package/ts/console/toConsoleMethod.ts +18 -0
- package/ts/console/types.ts +3 -0
- package/ts/customLogLevel.ts +35 -0
- package/{src → ts}/errors.ts +0 -0
- package/ts/formatter/createTimestampFormatter.ts +21 -0
- package/ts/formatter/formatLogLevel.ts +6 -0
- package/ts/formatter/index.ts +3 -0
- package/ts/formatter/plainLogFormatter.ts +6 -0
- package/ts/getDefaultReporter.browser.ts +13 -0
- package/ts/getDefaultReporter.ts +15 -0
- package/ts/getLogModeFromEnvironment.browser.ts +6 -0
- package/ts/getLogModeFromEnvironment.ts +16 -0
- package/ts/getLogger.ts +92 -0
- package/ts/getLoggers.ts +12 -0
- package/ts/index.ts +16 -0
- package/{src → ts}/logLevel.ts +0 -0
- package/ts/logLevelFn.ts +72 -0
- package/ts/logReporter.ts +26 -0
- package/ts/logReporterInternal.ts +18 -0
- package/ts/memory/MemoryLogReporter.ts +66 -0
- package/ts/memory/index.ts +2 -0
- package/ts/memory/logEntriesToString.ts +7 -0
- package/ts/memory/toInspectStringForObject.ts +13 -0
- package/ts/shouldLog.ts +11 -0
- package/ts/store.ts +25 -0
- package/ts/suppressLogs.ts +14 -0
- package/ts/testUtil.ts +19 -0
- package/{src → ts}/types.ts +0 -0
- package/ts/typesInternal.ts +21 -0
- package/ts/utils.ts +9 -0
- package/ts/writeToReporters.ts +20 -0
- package/CHANGELOG.md +0 -808
- package/dist/standard-log.js +0 -5444
- package/dist/standard-log.js.gz +0 -0
- package/dist/standard-log.js.map +0 -1
- package/dist/standard-log.js.map.gz +0 -0
- package/lib/LogEntry.d.ts.map +0 -1
- package/lib/LogEntry.js.map +0 -1
- package/lib/captureLogs.d.ts +0 -4
- package/lib/captureLogs.d.ts.map +0 -1
- package/lib/captureLogs.js +0 -33
- package/lib/captureLogs.js.map +0 -1
- package/lib/config.d.ts +0 -12
- package/lib/config.d.ts.map +0 -1
- package/lib/config.js +0 -49
- package/lib/config.js.map +0 -1
- package/lib/configForTest.d.ts +0 -5
- package/lib/configForTest.d.ts.map +0 -1
- package/lib/configForTest.js +0 -18
- package/lib/configForTest.js.map +0 -1
- package/lib/console/createConsoleLogReporter.d.ts +0 -9
- package/lib/console/createConsoleLogReporter.d.ts.map +0 -1
- package/lib/console/createConsoleLogReporter.js +0 -42
- package/lib/console/createConsoleLogReporter.js.map +0 -1
- package/lib/console/index.d.ts +0 -4
- package/lib/console/index.d.ts.map +0 -1
- package/lib/console/index.js +0 -7
- package/lib/console/index.js.map +0 -1
- package/lib/console/isConsoleDebugAvailable.d.ts.map +0 -1
- package/lib/console/isConsoleDebugAvailable.js +0 -18
- package/lib/console/isConsoleDebugAvailable.js.map +0 -1
- package/lib/console/polyfilledConsole.d.ts.map +0 -1
- package/lib/console/polyfilledConsole.js +0 -41
- package/lib/console/polyfilledConsole.js.map +0 -1
- package/lib/console/semverGt.d.ts.map +0 -1
- package/lib/console/semverGt.js.map +0 -1
- package/lib/console/toConsoleMethod.d.ts.map +0 -1
- package/lib/console/toConsoleMethod.js +0 -22
- package/lib/console/toConsoleMethod.js.map +0 -1
- package/lib/console/types.d.ts +0 -3
- package/lib/console/types.d.ts.map +0 -1
- package/lib/console/types.js.map +0 -1
- package/lib/customLogLevel.d.ts +0 -11
- package/lib/customLogLevel.d.ts.map +0 -1
- package/lib/customLogLevel.js +0 -38
- package/lib/customLogLevel.js.map +0 -1
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js +0 -46
- package/lib/errors.js.map +0 -1
- package/lib/formatter/createTimestampFormatter.d.ts.map +0 -1
- package/lib/formatter/createTimestampFormatter.js +0 -24
- package/lib/formatter/createTimestampFormatter.js.map +0 -1
- package/lib/formatter/formatLogLevel.d.ts.map +0 -1
- package/lib/formatter/formatLogLevel.js +0 -10
- package/lib/formatter/formatLogLevel.js.map +0 -1
- package/lib/formatter/index.d.ts +0 -4
- package/lib/formatter/index.d.ts.map +0 -1
- package/lib/formatter/index.js +0 -7
- package/lib/formatter/index.js.map +0 -1
- package/lib/formatter/plainLogFormatter.d.ts +0 -3
- package/lib/formatter/plainLogFormatter.d.ts.map +0 -1
- package/lib/formatter/plainLogFormatter.js +0 -11
- package/lib/formatter/plainLogFormatter.js.map +0 -1
- package/lib/getDefaultReporter.browser.d.ts.map +0 -1
- package/lib/getDefaultReporter.browser.js +0 -15
- package/lib/getDefaultReporter.browser.js.map +0 -1
- package/lib/getDefaultReporter.d.ts.map +0 -1
- package/lib/getDefaultReporter.js +0 -19
- package/lib/getDefaultReporter.js.map +0 -1
- package/lib/getLogModeFromEnvironment.browser.d.ts +0 -3
- package/lib/getLogModeFromEnvironment.browser.d.ts.map +0 -1
- package/lib/getLogModeFromEnvironment.browser.js.map +0 -1
- package/lib/getLogModeFromEnvironment.d.ts +0 -3
- package/lib/getLogModeFromEnvironment.d.ts.map +0 -1
- package/lib/getLogModeFromEnvironment.js +0 -17
- package/lib/getLogModeFromEnvironment.js.map +0 -1
- package/lib/getLogger.d.ts +0 -9
- package/lib/getLogger.d.ts.map +0 -1
- package/lib/getLogger.js +0 -95
- package/lib/getLogger.js.map +0 -1
- package/lib/getLoggers.d.ts +0 -7
- package/lib/getLoggers.d.ts.map +0 -1
- package/lib/getLoggers.js +0 -15
- package/lib/getLoggers.js.map +0 -1
- package/lib/index.d.ts +0 -16
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -19
- package/lib/index.js.map +0 -1
- package/lib/logLevel.d.ts.map +0 -1
- package/lib/logLevel.js.map +0 -1
- package/lib/logLevelFn.d.ts +0 -20
- package/lib/logLevelFn.d.ts.map +0 -1
- package/lib/logLevelFn.js +0 -76
- package/lib/logLevelFn.js.map +0 -1
- package/lib/logReporter.d.ts +0 -7
- package/lib/logReporter.d.ts.map +0 -1
- package/lib/logReporter.js +0 -29
- package/lib/logReporter.js.map +0 -1
- package/lib/logReporterInternal.d.ts +0 -3
- package/lib/logReporterInternal.d.ts.map +0 -1
- package/lib/logReporterInternal.js +0 -23
- package/lib/logReporterInternal.js.map +0 -1
- package/lib/memory/MemoryLogReporter.d.ts +0 -14
- package/lib/memory/MemoryLogReporter.d.ts.map +0 -1
- package/lib/memory/MemoryLogReporter.js +0 -56
- package/lib/memory/MemoryLogReporter.js.map +0 -1
- package/lib/memory/index.d.ts +0 -3
- package/lib/memory/index.d.ts.map +0 -1
- package/lib/memory/index.js +0 -6
- package/lib/memory/index.js.map +0 -1
- package/lib/memory/logEntriesToString.d.ts +0 -3
- package/lib/memory/logEntriesToString.d.ts.map +0 -1
- package/lib/memory/logEntriesToString.js +0 -10
- package/lib/memory/logEntriesToString.js.map +0 -1
- package/lib/memory/toInspectStringForObject.d.ts +0 -3
- package/lib/memory/toInspectStringForObject.d.ts.map +0 -1
- package/lib/memory/toInspectStringForObject.js +0 -15
- package/lib/memory/toInspectStringForObject.js.map +0 -1
- package/lib/shouldLog.d.ts +0 -8
- package/lib/shouldLog.d.ts.map +0 -1
- package/lib/shouldLog.js +0 -14
- package/lib/shouldLog.js.map +0 -1
- package/lib/store.d.ts +0 -3
- package/lib/store.d.ts.map +0 -1
- package/lib/store.js +0 -17
- package/lib/store.js.map +0 -1
- package/lib/testUtil.d.ts +0 -7
- package/lib/testUtil.d.ts.map +0 -1
- package/lib/testUtil.js +0 -23
- package/lib/testUtil.js.map +0 -1
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/typesInternal.d.ts +0 -20
- package/lib/typesInternal.d.ts.map +0 -1
- package/lib/typesInternal.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -14
- package/lib/utils.js.map +0 -1
- package/lib/writeToReporters.d.ts +0 -6
- package/lib/writeToReporters.d.ts.map +0 -1
- package/lib/writeToReporters.js +0 -22
- package/lib/writeToReporters.js.map +0 -1
- package/libm/LogEntry.d.ts.map +0 -1
- package/libm/LogEntry.js.map +0 -1
- package/libm/captureLogs.d.ts +0 -4
- package/libm/captureLogs.d.ts.map +0 -1
- package/libm/captureLogs.js +0 -29
- package/libm/captureLogs.js.map +0 -1
- package/libm/config.d.ts +0 -12
- package/libm/config.d.ts.map +0 -1
- package/libm/config.js +0 -44
- package/libm/config.js.map +0 -1
- package/libm/configForTest.d.ts +0 -5
- package/libm/configForTest.d.ts.map +0 -1
- package/libm/configForTest.js +0 -14
- package/libm/configForTest.js.map +0 -1
- package/libm/console/createConsoleLogReporter.d.ts +0 -9
- package/libm/console/createConsoleLogReporter.d.ts.map +0 -1
- package/libm/console/createConsoleLogReporter.js +0 -37
- package/libm/console/createConsoleLogReporter.js.map +0 -1
- package/libm/console/index.d.ts +0 -4
- package/libm/console/index.d.ts.map +0 -1
- package/libm/console/index.js +0 -4
- package/libm/console/index.js.map +0 -1
- package/libm/console/isConsoleDebugAvailable.d.ts.map +0 -1
- package/libm/console/isConsoleDebugAvailable.js +0 -13
- package/libm/console/isConsoleDebugAvailable.js.map +0 -1
- package/libm/console/polyfilledConsole.d.ts.map +0 -1
- package/libm/console/polyfilledConsole.js +0 -32
- package/libm/console/polyfilledConsole.js.map +0 -1
- package/libm/console/semverGt.d.ts.map +0 -1
- package/libm/console/semverGt.js.map +0 -1
- package/libm/console/toConsoleMethod.d.ts.map +0 -1
- package/libm/console/toConsoleMethod.js +0 -18
- package/libm/console/toConsoleMethod.js.map +0 -1
- package/libm/console/types.d.ts +0 -3
- package/libm/console/types.d.ts.map +0 -1
- package/libm/console/types.js.map +0 -1
- package/libm/customLogLevel.d.ts +0 -11
- package/libm/customLogLevel.d.ts.map +0 -1
- package/libm/customLogLevel.js +0 -30
- package/libm/customLogLevel.js.map +0 -1
- package/libm/errors.d.ts.map +0 -1
- package/libm/errors.js +0 -32
- package/libm/errors.js.map +0 -1
- package/libm/formatter/createTimestampFormatter.d.ts.map +0 -1
- package/libm/formatter/createTimestampFormatter.js.map +0 -1
- package/libm/formatter/formatLogLevel.d.ts.map +0 -1
- package/libm/formatter/formatLogLevel.js +0 -6
- package/libm/formatter/formatLogLevel.js.map +0 -1
- package/libm/formatter/index.d.ts +0 -4
- package/libm/formatter/index.d.ts.map +0 -1
- package/libm/formatter/index.js +0 -4
- package/libm/formatter/index.js.map +0 -1
- package/libm/formatter/plainLogFormatter.d.ts +0 -3
- package/libm/formatter/plainLogFormatter.d.ts.map +0 -1
- package/libm/formatter/plainLogFormatter.js +0 -5
- package/libm/formatter/plainLogFormatter.js.map +0 -1
- package/libm/getDefaultReporter.browser.d.ts.map +0 -1
- package/libm/getDefaultReporter.browser.js +0 -11
- package/libm/getDefaultReporter.browser.js.map +0 -1
- package/libm/getDefaultReporter.d.ts.map +0 -1
- package/libm/getDefaultReporter.js +0 -15
- package/libm/getDefaultReporter.js.map +0 -1
- package/libm/getLogModeFromEnvironment.browser.d.ts +0 -3
- package/libm/getLogModeFromEnvironment.browser.d.ts.map +0 -1
- package/libm/getLogModeFromEnvironment.browser.js.map +0 -1
- package/libm/getLogModeFromEnvironment.d.ts +0 -3
- package/libm/getLogModeFromEnvironment.d.ts.map +0 -1
- package/libm/getLogModeFromEnvironment.js +0 -13
- package/libm/getLogModeFromEnvironment.js.map +0 -1
- package/libm/getLogger.d.ts +0 -9
- package/libm/getLogger.d.ts.map +0 -1
- package/libm/getLogger.js +0 -78
- package/libm/getLogger.js.map +0 -1
- package/libm/getLoggers.d.ts +0 -7
- package/libm/getLoggers.d.ts.map +0 -1
- package/libm/getLoggers.js +0 -11
- package/libm/getLoggers.js.map +0 -1
- package/libm/index.d.ts +0 -16
- package/libm/index.d.ts.map +0 -1
- package/libm/index.js +0 -16
- package/libm/index.js.map +0 -1
- package/libm/logLevel.d.ts.map +0 -1
- package/libm/logLevel.js.map +0 -1
- package/libm/logLevelFn.d.ts +0 -20
- package/libm/logLevelFn.d.ts.map +0 -1
- package/libm/logLevelFn.js +0 -67
- package/libm/logLevelFn.js.map +0 -1
- package/libm/logReporter.d.ts +0 -7
- package/libm/logReporter.d.ts.map +0 -1
- package/libm/logReporter.js +0 -21
- package/libm/logReporter.js.map +0 -1
- package/libm/logReporterInternal.d.ts +0 -3
- package/libm/logReporterInternal.d.ts.map +0 -1
- package/libm/logReporterInternal.js +0 -19
- package/libm/logReporterInternal.js.map +0 -1
- package/libm/memory/MemoryLogReporter.d.ts +0 -14
- package/libm/memory/MemoryLogReporter.d.ts.map +0 -1
- package/libm/memory/MemoryLogReporter.js +0 -51
- package/libm/memory/MemoryLogReporter.js.map +0 -1
- package/libm/memory/index.d.ts +0 -3
- package/libm/memory/index.d.ts.map +0 -1
- package/libm/memory/index.js +0 -3
- package/libm/memory/index.js.map +0 -1
- package/libm/memory/logEntriesToString.d.ts +0 -3
- package/libm/memory/logEntriesToString.d.ts.map +0 -1
- package/libm/memory/logEntriesToString.js +0 -6
- package/libm/memory/logEntriesToString.js.map +0 -1
- package/libm/memory/toInspectStringForObject.d.ts +0 -3
- package/libm/memory/toInspectStringForObject.d.ts.map +0 -1
- package/libm/memory/toInspectStringForObject.js.map +0 -1
- package/libm/shouldLog.d.ts +0 -8
- package/libm/shouldLog.d.ts.map +0 -1
- package/libm/shouldLog.js +0 -10
- package/libm/shouldLog.js.map +0 -1
- package/libm/store.d.ts +0 -3
- package/libm/store.d.ts.map +0 -1
- package/libm/store.js +0 -24
- package/libm/store.js.map +0 -1
- package/libm/testUtil.d.ts +0 -7
- package/libm/testUtil.d.ts.map +0 -1
- package/libm/testUtil.js +0 -17
- package/libm/testUtil.js.map +0 -1
- package/libm/types.d.ts.map +0 -1
- package/libm/types.js.map +0 -1
- package/libm/typesInternal.d.ts +0 -20
- package/libm/typesInternal.d.ts.map +0 -1
- package/libm/typesInternal.js.map +0 -1
- package/libm/utils.d.ts.map +0 -1
- package/libm/utils.js +0 -10
- package/libm/utils.js.map +0 -1
- package/libm/writeToReporters.d.ts +0 -6
- package/libm/writeToReporters.d.ts.map +0 -1
- package/libm/writeToReporters.js +0 -18
- package/libm/writeToReporters.js.map +0 -1
- package/src/captureLogs.spec.ts +0 -52
- package/src/captureLogs.ts +0 -35
- package/src/config.spec.ts +0 -73
- package/src/config.ts +0 -57
- package/src/configForTest.spec.ts +0 -16
- package/src/configForTest.ts +0 -16
- package/src/console/createConsoleLogReporter.spec.ts +0 -198
- package/src/console/createConsoleLogReporter.ts +0 -42
- package/src/console/index.ts +0 -3
- package/src/console/isConsoleDebugAvailable.ts +0 -11
- package/src/console/polyfilledConsole.ts +0 -34
- package/src/console/semverGt.spec.ts +0 -25
- package/src/console/toConsoleMethod.ts +0 -18
- package/src/console/types.ts +0 -3
- package/src/customLogLevel.spec.ts +0 -39
- package/src/customLogLevel.ts +0 -35
- package/src/formatter/createTimestampFormatter.spec.ts +0 -24
- package/src/formatter/createTimestampFormatter.ts +0 -21
- package/src/formatter/formatLogLevel.ts +0 -6
- package/src/formatter/index.ts +0 -3
- package/src/formatter/plainLogFormatter.spec.ts +0 -8
- package/src/formatter/plainLogFormatter.ts +0 -6
- package/src/getDefaultReporter.browser.ts +0 -13
- package/src/getDefaultReporter.ts +0 -15
- package/src/getLogModeFromEnvironment.browser.ts +0 -6
- package/src/getLogModeFromEnvironment.spec.ts +0 -16
- package/src/getLogModeFromEnvironment.ts +0 -16
- package/src/getLogger.spec.ts +0 -460
- package/src/getLogger.ts +0 -92
- package/src/getLoggers.ts +0 -12
- package/src/index.ts +0 -15
- package/src/logLevel.spec.ts +0 -161
- package/src/logLevelFn.ts +0 -72
- package/src/logReporter.spec.ts +0 -99
- package/src/logReporter.ts +0 -26
- package/src/logReporterInternal.ts +0 -18
- package/src/memory/MemoryLogReporter.spec.ts +0 -114
- package/src/memory/MemoryLogReporter.ts +0 -66
- package/src/memory/index.ts +0 -2
- package/src/memory/logEntriesToString.spec.ts +0 -47
- package/src/memory/logEntriesToString.ts +0 -7
- package/src/memory/toInspectStringForObject.ts +0 -13
- package/src/shouldLog.ts +0 -11
- package/src/store.ts +0 -25
- package/src/testUtil.ts +0 -19
- package/src/types.spec.ts +0 -7
- package/src/typesInternal.ts +0 -21
- package/src/utils.ts +0 -9
- package/src/writeToReporters.spec.ts +0 -9
- package/src/writeToReporters.ts +0 -20
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var assertron_1 = __importDefault(require("assertron"));
|
|
7
|
+
var index_js_1 = require("../index.js");
|
|
8
|
+
var store_js_1 = require("../store.js");
|
|
9
|
+
describe('production checks', function () {
|
|
10
|
+
beforeEach(function () { return store_js_1.store.reset(); });
|
|
11
|
+
test('set filter during production mode throws', function () {
|
|
12
|
+
(0, index_js_1.config)({ mode: 'production' });
|
|
13
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
14
|
+
assertron_1.default.throws(function () { reporter.filter = function () { return true; }; }, index_js_1.ProhibitedDuringProduction);
|
|
15
|
+
});
|
|
16
|
+
var idFormatter = function (entry) { return [entry.id]; };
|
|
17
|
+
test('set formatter during production mode throws', function () {
|
|
18
|
+
(0, index_js_1.config)({ mode: 'production' });
|
|
19
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
20
|
+
assertron_1.default.throws(function () { return reporter.formatter = idFormatter; }, index_js_1.ProhibitedDuringProduction);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('unit tests', function () {
|
|
24
|
+
beforeEach(function () { return (0, index_js_1.configForTest)(); });
|
|
25
|
+
describe('rendering tests', function () {
|
|
26
|
+
test('plain rendering', function () {
|
|
27
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: index_js_1.plainLogFormatter });
|
|
28
|
+
['emergency', 'info', 'warn', 'debug'].forEach(function (level) {
|
|
29
|
+
reporter.write({ id: 'plain', level: index_js_1.logLevels[level], args: ['hello', 'world'], timestamp: new Date() });
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('id', function () {
|
|
34
|
+
test('default is "console"', function () {
|
|
35
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
36
|
+
expect(reporter.id).toBe('console');
|
|
37
|
+
});
|
|
38
|
+
test('can be overridden', function () {
|
|
39
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)({ id: 'neo-console' });
|
|
40
|
+
expect(reporter.id).toBe('neo-console');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('log level', function () {
|
|
44
|
+
test('error, alert, critical and emergency logs are written to console.error', function () {
|
|
45
|
+
var id = 'log';
|
|
46
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
47
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
48
|
+
reporter.write({ id: id, level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
|
|
49
|
+
reporter.write({ id: id, level: index_js_1.logLevels.critical, args: ['critical'], timestamp: new Date() });
|
|
50
|
+
reporter.write({ id: id, level: index_js_1.logLevels.alert, args: ['alert'], timestamp: new Date() });
|
|
51
|
+
reporter.write({ id: id, level: index_js_1.logLevels.error, args: ['error'], timestamp: new Date() });
|
|
52
|
+
expect(fakeConsole.errors.length).toBe(4);
|
|
53
|
+
});
|
|
54
|
+
test('warn logs are written to console.warn', function () {
|
|
55
|
+
var id = 'log';
|
|
56
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
57
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
58
|
+
reporter.write({ id: id, level: index_js_1.logLevels.warn, args: ['warn'], timestamp: new Date() });
|
|
59
|
+
expect(fakeConsole.warns.length).toBe(1);
|
|
60
|
+
});
|
|
61
|
+
test('notice and info logs are written to console.info', function () {
|
|
62
|
+
var id = 'log';
|
|
63
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
64
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
65
|
+
reporter.write({ id: id, level: index_js_1.logLevels.notice, args: ['notice'], timestamp: new Date() });
|
|
66
|
+
reporter.write({ id: id, level: index_js_1.logLevels.info, args: ['info'], timestamp: new Date() });
|
|
67
|
+
expect(fakeConsole.infos.length).toBe(2);
|
|
68
|
+
});
|
|
69
|
+
test('debug, trace, and planck logs are written to console.debug', function () {
|
|
70
|
+
var id = 'log';
|
|
71
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
72
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
73
|
+
reporter.write({ id: id, level: index_js_1.logLevels.debug, args: ['debug'], timestamp: new Date() });
|
|
74
|
+
reporter.write({ id: id, level: index_js_1.logLevels.trace, args: ['trace'], timestamp: new Date() });
|
|
75
|
+
reporter.write({ id: id, level: index_js_1.logLevels.planck, args: ['planck'], timestamp: new Date() });
|
|
76
|
+
expect(fakeConsole.debugs.length).toBe(3);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('custom logs', function () {
|
|
80
|
+
afterEach(function () { return (0, index_js_1.clearCustomLogLevel)(); });
|
|
81
|
+
test('are written according to their log level value', function () {
|
|
82
|
+
(0, index_js_1.addCustomLogLevel)('high', 50);
|
|
83
|
+
(0, index_js_1.addCustomLogLevel)('important', 450);
|
|
84
|
+
(0, index_js_1.addCustomLogLevel)('interest', 650);
|
|
85
|
+
(0, index_js_1.addCustomLogLevel)('silly', 1000);
|
|
86
|
+
var id = 'log';
|
|
87
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
88
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
89
|
+
reporter.write({ id: id, level: 50, args: ['a'], timestamp: new Date() });
|
|
90
|
+
reporter.write({ id: id, level: 450, args: ['b'], timestamp: new Date() });
|
|
91
|
+
reporter.write({ id: id, level: 650, args: ['c'], timestamp: new Date() });
|
|
92
|
+
reporter.write({ id: id, level: 1000, args: ['d'], timestamp: new Date() });
|
|
93
|
+
expect(fakeConsole.errors.length).toBe(1);
|
|
94
|
+
expect(fakeConsole.warns.length).toBe(1);
|
|
95
|
+
expect(fakeConsole.infos.length).toBe(1);
|
|
96
|
+
expect(fakeConsole.debugs.length).toBe(1);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
var idFormatter = function (entry) { return [entry.id]; };
|
|
100
|
+
describe('formatter', function () {
|
|
101
|
+
test('use specific formatter', function () {
|
|
102
|
+
var id = 'id-only';
|
|
103
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: idFormatter });
|
|
104
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
105
|
+
reporter.write({ id: id, level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
|
|
106
|
+
expect(fakeConsole.errors).toEqual([['id-only']]);
|
|
107
|
+
});
|
|
108
|
+
test('formatter can be changed afterward', function () {
|
|
109
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
110
|
+
var formatter = reporter.formatter;
|
|
111
|
+
reporter.formatter = idFormatter;
|
|
112
|
+
expect(reporter.formatter).not.toEqual(formatter);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
describe('filter', function () {
|
|
116
|
+
var filter = function (entry) { return entry.id !== 'secret'; };
|
|
117
|
+
test('use specific filter', function () {
|
|
118
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: idFormatter, filter: filter });
|
|
119
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
120
|
+
reporter.write({ id: 'normal', level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
|
|
121
|
+
reporter.write({ id: 'secret', level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
|
|
122
|
+
expect(fakeConsole.errors).toEqual([['normal']]);
|
|
123
|
+
});
|
|
124
|
+
test('can change filter', function () {
|
|
125
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)();
|
|
126
|
+
var filter = reporter.filter;
|
|
127
|
+
reporter.filter = function (entry) { return entry.id !== 'secret'; };
|
|
128
|
+
expect(reporter.filter).not.toEqual(filter);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
test('write log entry with multiple arguments', function () {
|
|
132
|
+
var id = 'log';
|
|
133
|
+
var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: index_js_1.plainLogFormatter });
|
|
134
|
+
var fakeConsole = reporter.console = createFakeConsole();
|
|
135
|
+
var entry = { id: id, level: index_js_1.logLevels.info, args: ['a', 'b', 'c'], timestamp: new Date() };
|
|
136
|
+
reporter.write(entry);
|
|
137
|
+
expect(fakeConsole.infos).toEqual([
|
|
138
|
+
[entry.timestamp.toISOString(), 'log', '(INFO)', 'a', 'b', 'c']
|
|
139
|
+
]);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
function createFakeConsole() {
|
|
143
|
+
var errors = [];
|
|
144
|
+
var infos = [];
|
|
145
|
+
var warns = [];
|
|
146
|
+
var debugs = [];
|
|
147
|
+
return {
|
|
148
|
+
errors: errors,
|
|
149
|
+
infos: infos,
|
|
150
|
+
warns: warns,
|
|
151
|
+
debugs: debugs,
|
|
152
|
+
error: function () {
|
|
153
|
+
var args = [];
|
|
154
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
155
|
+
args[_i] = arguments[_i];
|
|
156
|
+
}
|
|
157
|
+
errors.push(args);
|
|
158
|
+
},
|
|
159
|
+
info: function () {
|
|
160
|
+
var args = [];
|
|
161
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
162
|
+
args[_i] = arguments[_i];
|
|
163
|
+
}
|
|
164
|
+
infos.push(args);
|
|
165
|
+
},
|
|
166
|
+
warn: function () {
|
|
167
|
+
var args = [];
|
|
168
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
169
|
+
args[_i] = arguments[_i];
|
|
170
|
+
}
|
|
171
|
+
warns.push(args);
|
|
172
|
+
},
|
|
173
|
+
debug: function () {
|
|
174
|
+
var args = [];
|
|
175
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
176
|
+
args[_i] = arguments[_i];
|
|
177
|
+
}
|
|
178
|
+
debugs.push(args);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=createConsoleLogReporter.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createConsoleLogReporter.spec.js","sourceRoot":"","sources":["../../ts/console/createConsoleLogReporter.spec.ts"],"names":[],"mappings":";;;;;AAAA,wDAAyB;AACzB,wCAIoB;AACpB,wCAAmC;AAEnC,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,UAAU,CAAC,cAAM,OAAA,gBAAK,CAAC,KAAK,EAAE,EAAb,CAAa,CAAC,CAAA;IAE/B,IAAI,CAAC,0CAA0C,EAAE;QAC/C,IAAA,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AC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;QACzC,IAAI,EAAJ;YAAK,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;QACzC,KAAK,EAAL;YAAM,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;KAC5C,CAAA;AACH,CAAC","sourcesContent":["import a from 'assertron'\nimport {\n addCustomLogLevel, clearCustomLogLevel, config, configForTest,\n ConsoleLogFormatter, createConsoleLogReporter,\n LogFilter, logLevels, plainLogFormatter, ProhibitedDuringProduction\n} from '../index.js'\nimport { store } from '../store.js'\n\ndescribe('production checks', () => {\n beforeEach(() => store.reset())\n\n test('set filter during production mode throws', () => {\n config({ mode: 'production' })\n const reporter = createConsoleLogReporter()\n a.throws(() => { reporter.filter = () => true }, ProhibitedDuringProduction)\n })\n\n const idFormatter: ConsoleLogFormatter = (entry) => [entry.id]\n test('set formatter during production mode throws', () => {\n config({ mode: 'production' })\n const reporter = createConsoleLogReporter()\n a.throws(() => reporter.formatter = idFormatter, ProhibitedDuringProduction)\n })\n})\n\n\ndescribe('unit tests', () => {\n beforeEach(() => configForTest())\n\n describe('rendering tests', () => {\n test('plain rendering', () => {\n const reporter = createConsoleLogReporter({ formatter: plainLogFormatter });\n ['emergency', 'info', 'warn', 'debug'].forEach(level => {\n reporter.write({ id: 'plain', level: (logLevels as any)[level], args: ['hello', 'world'], timestamp: new Date() })\n })\n })\n })\n\n describe('id', () => {\n test('default is \"console\"', () => {\n const reporter = createConsoleLogReporter()\n expect(reporter.id).toBe('console')\n })\n test('can be overridden', () => {\n const reporter = createConsoleLogReporter({ id: 'neo-console' })\n expect(reporter.id).toBe('neo-console')\n })\n })\n\n describe('log level', () => {\n test('error, alert, critical and emergency logs are written to console.error', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.critical, args: ['critical'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.alert, args: ['alert'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.error, args: ['error'], timestamp: new Date() })\n\n expect(fakeConsole.errors.length).toBe(4)\n })\n\n test('warn logs are written to console.warn', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.warn, args: ['warn'], timestamp: new Date() })\n\n expect(fakeConsole.warns.length).toBe(1)\n })\n\n test('notice and info logs are written to console.info', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.notice, args: ['notice'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.info, args: ['info'], timestamp: new Date() })\n\n expect(fakeConsole.infos.length).toBe(2)\n })\n\n\n test('debug, trace, and planck logs are written to console.debug', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.debug, args: ['debug'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.trace, args: ['trace'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.planck, args: ['planck'], timestamp: new Date() })\n\n expect(fakeConsole.debugs.length).toBe(3)\n })\n })\n\n describe('custom logs', () => {\n afterEach(() => clearCustomLogLevel())\n\n test('are written according to their log level value', () => {\n addCustomLogLevel('high', 50)\n addCustomLogLevel('important', 450)\n addCustomLogLevel('interest', 650)\n addCustomLogLevel('silly', 1000)\n\n const id = 'log'\n const reporter = createConsoleLogReporter()\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: 50, args: ['a'], timestamp: new Date() })\n reporter.write({ id, level: 450, args: ['b'], timestamp: new Date() })\n reporter.write({ id, level: 650, args: ['c'], timestamp: new Date() })\n reporter.write({ id, level: 1000, args: ['d'], timestamp: new Date() })\n\n expect(fakeConsole.errors.length).toBe(1)\n expect(fakeConsole.warns.length).toBe(1)\n expect(fakeConsole.infos.length).toBe(1)\n expect(fakeConsole.debugs.length).toBe(1)\n })\n })\n\n const idFormatter: ConsoleLogFormatter = (entry) => [entry.id]\n\n describe('formatter', () => {\n test('use specific formatter', () => {\n const id = 'id-only'\n const reporter = createConsoleLogReporter({ formatter: idFormatter })\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n\n expect(fakeConsole.errors).toEqual([['id-only']])\n })\n\n test('formatter can be changed afterward', () => {\n const reporter = createConsoleLogReporter()\n const formatter = reporter.formatter\n reporter.formatter = idFormatter\n expect(reporter.formatter).not.toEqual(formatter)\n })\n })\n\n describe('filter', () => {\n const filter: LogFilter = (entry) => entry.id !== 'secret'\n test('use specific filter', () => {\n const reporter = createConsoleLogReporter({ formatter: idFormatter, filter })\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id: 'normal', level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n reporter.write({ id: 'secret', level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n\n expect(fakeConsole.errors).toEqual([['normal']])\n })\n\n test('can change filter', () => {\n const reporter = createConsoleLogReporter()\n const filter = reporter.filter\n reporter.filter = entry => entry.id !== 'secret'\n expect(reporter.filter).not.toEqual(filter)\n })\n })\n\n test('write log entry with multiple arguments', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter({ formatter: plainLogFormatter })\n const fakeConsole = reporter.console = createFakeConsole()\n\n const entry = { id, level: logLevels.info, args: ['a', 'b', 'c'], timestamp: new Date() }\n\n reporter.write(entry)\n\n expect(fakeConsole.infos).toEqual([\n [entry.timestamp.toISOString(), 'log', '(INFO)', 'a', 'b', 'c']\n ])\n })\n})\n\n\nfunction createFakeConsole() {\n const errors: any[] = []\n const infos: any[] = []\n const warns: any[] = []\n const debugs: any[] = []\n return {\n errors,\n infos,\n warns,\n debugs,\n error(...args: any[]) { errors.push(args) },\n info(...args: any[]) { infos.push(args) },\n warn(...args: any[]) { warns.push(args) },\n debug(...args: any[]) { debugs.push(args) }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/console/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./createConsoleLogReporter.js"), exports);
|
|
18
|
+
__exportStar(require("./toConsoleMethod.js"), exports);
|
|
19
|
+
__exportStar(require("./types.js"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/console/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA6C;AAC7C,uDAAoC;AACpC,6CAA0B","sourcesContent":["export * from './createConsoleLogReporter.js'\nexport * from './toConsoleMethod.js'\nexport * from './types.js'\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isConsoleDebugAvailable.d.ts","sourceRoot":"","sources":["../../ts/console/isConsoleDebugAvailable.ts"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,YAMtC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isConsoleDebugAvailable = void 0;
|
|
7
|
+
var is_node_1 = __importDefault(require("is-node"));
|
|
8
|
+
var semverGt_js_1 = require("./semverGt.js");
|
|
9
|
+
// istanbul ignore file
|
|
10
|
+
function isConsoleDebugAvailable() {
|
|
11
|
+
if (!is_node_1.default)
|
|
12
|
+
return true;
|
|
13
|
+
// without this, systemJs will complain `process is not defined`
|
|
14
|
+
if (!global.process)
|
|
15
|
+
return true;
|
|
16
|
+
var versionString = process.version.startsWith('v') ? process.version.slice(1) : process.version;
|
|
17
|
+
return (0, semverGt_js_1.semverGt)(versionString, [9, 3, 0]);
|
|
18
|
+
}
|
|
19
|
+
exports.isConsoleDebugAvailable = isConsoleDebugAvailable;
|
|
20
|
+
//# sourceMappingURL=isConsoleDebugAvailable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isConsoleDebugAvailable.js","sourceRoot":"","sources":["../../ts/console/isConsoleDebugAvailable.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6CAAwC;AAExC,uBAAuB;AACvB,SAAgB,uBAAuB;IACrC,IAAI,CAAC,iBAAM;QAAE,OAAO,IAAI,CAAA;IACxB,gEAAgE;IAChE,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAChC,IAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;IAClG,OAAO,IAAA,sBAAQ,EAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC3C,CAAC;AAND,0DAMC","sourcesContent":["import isNode from 'is-node'\nimport { semverGt } from './semverGt.js'\n\n// istanbul ignore file\nexport function isConsoleDebugAvailable() {\n if (!isNode) return true\n // without this, systemJs will complain `process is not defined`\n if (!global.process) return true\n const versionString = process.version.startsWith('v') ? process.version.slice(1) : process.version\n return semverGt(versionString, [9, 3, 0])\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyfilledConsole.d.ts","sourceRoot":"","sources":["../../ts/console/polyfilledConsole.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,iBAAiB;;;;;CAAyB,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.polyfilledConsole = void 0;
|
|
4
|
+
/* istanbul ignore file */
|
|
5
|
+
var isConsoleDebugAvailable_js_1 = require("./isConsoleDebugAvailable.js");
|
|
6
|
+
/* eslint-disable no-console */
|
|
7
|
+
function buildPolyfillConsole() {
|
|
8
|
+
// old phantomjs does not have bind function
|
|
9
|
+
var hasBind = !!console.log.bind;
|
|
10
|
+
if (hasBind) {
|
|
11
|
+
return {
|
|
12
|
+
// Node@9.3 or below has `console.debug = undefined` or it doesn't log
|
|
13
|
+
// Should use `console.log()` in those case.
|
|
14
|
+
debug: ((0, isConsoleDebugAvailable_js_1.isConsoleDebugAvailable)() ? console.debug : console.log).bind(console),
|
|
15
|
+
// the `typeof` guards against IE where `console.log.apply()`
|
|
16
|
+
// results in error `Object doesn't support property or method 'apply'`
|
|
17
|
+
info: (typeof console.info === 'function' ? console.info : console.log).bind(console),
|
|
18
|
+
warn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),
|
|
19
|
+
error: (typeof console.error === 'function' ? console.error : console.log).bind(console)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return {
|
|
24
|
+
debug: buildFn((0, isConsoleDebugAvailable_js_1.isConsoleDebugAvailable)() ? 'debug' : 'log'),
|
|
25
|
+
info: buildFn(typeof console.info === 'function' ? 'info' : 'log'),
|
|
26
|
+
warn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),
|
|
27
|
+
error: buildFn(typeof console.error === 'function' ? 'error' : 'log'),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function buildFn(name) {
|
|
32
|
+
return function () {
|
|
33
|
+
var args = [];
|
|
34
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
35
|
+
args[_i] = arguments[_i];
|
|
36
|
+
}
|
|
37
|
+
console[name].apply(console, args);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.polyfilledConsole = buildPolyfillConsole();
|
|
41
|
+
//# sourceMappingURL=polyfilledConsole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyfilledConsole.js","sourceRoot":"","sources":["../../ts/console/polyfilledConsole.ts"],"names":[],"mappings":";;;AAAA,0BAA0B;AAC1B,2EAAsE;AACtE,+BAA+B;AAE/B,SAAS,oBAAoB;IAC3B,4CAA4C;IAC5C,IAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAe,CAAA;IAC7C,IAAI,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,CAAC;SACtE,CAAA;KACF;AACH,CAAC;AAED,SAAS,OAAO,CAAC,IAAiD;IAChE,OAAO;QAAU,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QAAI,OAAO,CAAC,IAAI,CAAC,OAAb,OAAO,EAAU,IAAI,EAAC;IAAC,CAAC,CAAA;AAC7D,CAAC;AAEY,QAAA,iBAAiB,GAAG,oBAAoB,EAAE,CAAA","sourcesContent":["/* istanbul ignore file */\nimport { isConsoleDebugAvailable } from './isConsoleDebugAvailable.js'\n/* eslint-disable no-console */\n\nfunction buildPolyfillConsole() {\n // old phantomjs does not have bind function\n const hasBind = !!console.log.bind as boolean\n if (hasBind) {\n return {\n // Node@9.3 or below has `console.debug = undefined` or it doesn't log\n // Should use `console.log()` in those case.\n debug: (isConsoleDebugAvailable() ? console.debug : console.log).bind(console),\n // the `typeof` guards against IE where `console.log.apply()`\n // results in error `Object doesn't support property or method 'apply'`\n info: (typeof console.info === 'function' ? console.info : console.log).bind(console),\n warn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),\n error: (typeof console.error === 'function' ? console.error : console.log).bind(console)\n }\n }\n else {\n return {\n debug: buildFn(isConsoleDebugAvailable() ? 'debug' : 'log'),\n info: buildFn(typeof console.info === 'function' ? 'info' : 'log'),\n warn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),\n error: buildFn(typeof console.error === 'function' ? 'error' : 'log'),\n }\n }\n}\n\nfunction buildFn(name: 'debug' | 'info' | 'warn' | 'error' | 'log') {\n return function (...args: any[]) { console[name](...args) }\n}\n\nexport const polyfilledConsole = buildPolyfillConsole()\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semverGt.d.ts","sourceRoot":"","sources":["../../ts/console/semverGt.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,WAOhF"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semverGt.js","sourceRoot":"","sources":["../../ts/console/semverGt.ts"],"names":[],"mappings":";;;AAAA,uBAAuB;AACvB,SAAgB,QAAQ,CAAC,aAAqB,EAAE,OAAiC;IAC/E,IAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC/D,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QAC9C,OAAO,CAAC,CAAA;IACV,CAAC,EAAE,CAAC,CAAC,CAAA;IAEL,OAAO,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AACtE,CAAC;AAPD,4BAOC","sourcesContent":["// istanbul ignore next\nexport function semverGt(versionString: string, version: [number, number, number]) {\n const actual = versionString.split('.').reverse().reduce((p, v, i) => {\n p += Number.parseInt(v, 10) * Math.pow(100, i)\n return p\n }, 0)\n\n return actual > (version[0] * 10000 + version[1] * 100 + version[2])\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semverGt.spec.d.ts","sourceRoot":"","sources":["../../ts/console/semverGt.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var semverGt_js_1 = require("./semverGt.js");
|
|
4
|
+
test('9.3.0 returns false', function () {
|
|
5
|
+
expect((0, semverGt_js_1.semverGt)('9.3.0', [9, 3, 0])).toBe(false);
|
|
6
|
+
});
|
|
7
|
+
test('9.3.1 returns true', function () {
|
|
8
|
+
expect((0, semverGt_js_1.semverGt)('9.3.1', [9, 3, 0])).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
test('9.3.1 returns true', function () {
|
|
11
|
+
expect((0, semverGt_js_1.semverGt)('9.3.1', [9, 3, 0])).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
test('9.4.0 returns true', function () {
|
|
14
|
+
expect((0, semverGt_js_1.semverGt)('9.4.0', [9, 3, 0])).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
test('9.10.0 returns true', function () {
|
|
17
|
+
expect((0, semverGt_js_1.semverGt)('9.10.0', [9, 3, 0])).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
test('10.0.0 returns true', function () {
|
|
20
|
+
expect((0, semverGt_js_1.semverGt)('10.0.0', [9, 3, 0])).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=semverGt.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semverGt.spec.js","sourceRoot":"","sources":["../../ts/console/semverGt.spec.ts"],"names":[],"mappings":";;AAAA,6CAAwC;AAExC,IAAI,CAAC,qBAAqB,EAAE;IAC1B,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oBAAoB,EAAE;IACzB,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oBAAoB,EAAE;IACzB,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oBAAoB,EAAE;IACzB,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,qBAAqB,EAAE;IAC1B,MAAM,CAAC,IAAA,sBAAQ,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,qBAAqB,EAAE;IAC1B,MAAM,CAAC,IAAA,sBAAQ,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA","sourcesContent":["import { semverGt } from './semverGt.js'\n\ntest('9.3.0 returns false', () => {\n expect(semverGt('9.3.0', [9, 3, 0])).toBe(false)\n})\n\ntest('9.3.1 returns true', () => {\n expect(semverGt('9.3.1', [9, 3, 0])).toBe(true)\n})\n\ntest('9.3.1 returns true', () => {\n expect(semverGt('9.3.1', [9, 3, 0])).toBe(true)\n})\n\ntest('9.4.0 returns true', () => {\n expect(semverGt('9.4.0', [9, 3, 0])).toBe(true)\n})\n\ntest('9.10.0 returns true', () => {\n expect(semverGt('9.10.0', [9, 3, 0])).toBe(true)\n})\n\ntest('10.0.0 returns true', () => {\n expect(semverGt('10.0.0', [9, 3, 0])).toBe(true)\n})\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toConsoleMethod.d.ts","sourceRoot":"","sources":["../../ts/console/toConsoleMethod.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,uCAe5C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toConsoleMethod = void 0;
|
|
4
|
+
var logLevel_js_1 = require("../logLevel.js");
|
|
5
|
+
function toConsoleMethod(level) {
|
|
6
|
+
switch (true) {
|
|
7
|
+
// istanbul ignore next
|
|
8
|
+
case (level === 0):
|
|
9
|
+
// edge case in case none is somehow written
|
|
10
|
+
return 'debug';
|
|
11
|
+
case (level <= logLevel_js_1.logLevels.error):
|
|
12
|
+
return 'error';
|
|
13
|
+
case (level <= logLevel_js_1.logLevels.warn):
|
|
14
|
+
return 'warn';
|
|
15
|
+
case (level <= logLevel_js_1.logLevels.info):
|
|
16
|
+
return 'info';
|
|
17
|
+
default:
|
|
18
|
+
return 'debug';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.toConsoleMethod = toConsoleMethod;
|
|
22
|
+
//# sourceMappingURL=toConsoleMethod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toConsoleMethod.js","sourceRoot":"","sources":["../../ts/console/toConsoleMethod.ts"],"names":[],"mappings":";;;AAAA,8CAA0C;AAE1C,SAAgB,eAAe,CAAC,KAAa;IAC3C,QAAQ,IAAI,EAAE;QACZ,uBAAuB;QACvB,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;YAChB,4CAA4C;YAC5C,OAAO,OAAO,CAAA;QAChB,KAAK,CAAC,KAAK,IAAI,uBAAS,CAAC,KAAK,CAAC;YAC7B,OAAO,OAAO,CAAA;QAChB,KAAK,CAAC,KAAK,IAAI,uBAAS,CAAC,IAAI,CAAC;YAC5B,OAAO,MAAM,CAAA;QACf,KAAK,CAAC,KAAK,IAAI,uBAAS,CAAC,IAAI,CAAC;YAC5B,OAAO,MAAM,CAAA;QACf;YACE,OAAO,OAAO,CAAA;KACjB;AACH,CAAC;AAfD,0CAeC","sourcesContent":["import { logLevels } from '../logLevel.js'\n\nexport function toConsoleMethod(level: number) {\n switch (true) {\n // istanbul ignore next\n case (level === 0):\n // edge case in case none is somehow written\n return 'debug'\n case (level <= logLevels.error):\n return 'error'\n case (level <= logLevels.warn):\n return 'warn'\n case (level <= logLevels.info):\n return 'info'\n default:\n return 'debug'\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../ts/console/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D,oBAAY,OAAO,GAAG,OAAO,iBAAiB,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../ts/console/types.ts"],"names":[],"mappings":"","sourcesContent":["import { polyfilledConsole } from './polyfilledConsole.js'\n\nexport type Console = typeof polyfilledConsole\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LogLevelEntry } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @param level the `logLevel` number.
|
|
4
|
+
* You can specify this in the form of `logLevel.<x> + n` to make it more readable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function addCustomLogLevel(name: string, level: number): void;
|
|
7
|
+
export declare function clearCustomLogLevel(): void;
|
|
8
|
+
export declare function getCustomLevel(name: string): number | undefined;
|
|
9
|
+
export declare function getCustomLevelName(level: number): string | undefined;
|
|
10
|
+
export declare function getCustomLevels(): LogLevelEntry[];
|
|
11
|
+
//# sourceMappingURL=customLogLevel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customLogLevel.d.ts","sourceRoot":"","sources":["../ts/customLogLevel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAM5D;AAED,wBAAgB,mBAAmB,SAKlC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpE;AAED,wBAAgB,eAAe,IAAI,aAAa,EAAE,CAGjD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCustomLevels = exports.getCustomLevelName = exports.getCustomLevel = exports.clearCustomLogLevel = exports.addCustomLogLevel = void 0;
|
|
4
|
+
var type_plus_1 = require("type-plus");
|
|
5
|
+
var store_js_1 = require("./store.js");
|
|
6
|
+
/**
|
|
7
|
+
* @param level the `logLevel` number.
|
|
8
|
+
* You can specify this in the form of `logLevel.<x> + n` to make it more readable.
|
|
9
|
+
*/
|
|
10
|
+
function addCustomLogLevel(name, level) {
|
|
11
|
+
var _a = store_js_1.store.value, customLevels = _a.customLevels, customLevelsReverse = _a.customLevelsReverse;
|
|
12
|
+
customLevels[name] = level;
|
|
13
|
+
customLevelsReverse[level] = name;
|
|
14
|
+
var loggerClosures = store_js_1.store.value.loggerClosures;
|
|
15
|
+
(0, type_plus_1.forEachKey)(loggerClosures, function (id) { return loggerClosures[id].addMethod(name, level); });
|
|
16
|
+
}
|
|
17
|
+
exports.addCustomLogLevel = addCustomLogLevel;
|
|
18
|
+
function clearCustomLogLevel() {
|
|
19
|
+
var _a = store_js_1.store.value, customLevels = _a.customLevels, customLevelsReverse = _a.customLevelsReverse;
|
|
20
|
+
// Don't replace the object would prevent reference divergence
|
|
21
|
+
(0, type_plus_1.forEachKey)(customLevels, function (k) { return delete customLevels[k]; });
|
|
22
|
+
customLevelsReverse.splice(0, customLevelsReverse.length);
|
|
23
|
+
}
|
|
24
|
+
exports.clearCustomLogLevel = clearCustomLogLevel;
|
|
25
|
+
function getCustomLevel(name) {
|
|
26
|
+
return store_js_1.store.value.customLevels[name];
|
|
27
|
+
}
|
|
28
|
+
exports.getCustomLevel = getCustomLevel;
|
|
29
|
+
function getCustomLevelName(level) {
|
|
30
|
+
return store_js_1.store.value.customLevelsReverse[level];
|
|
31
|
+
}
|
|
32
|
+
exports.getCustomLevelName = getCustomLevelName;
|
|
33
|
+
function getCustomLevels() {
|
|
34
|
+
var customLevels = store_js_1.store.value.customLevels;
|
|
35
|
+
return (0, type_plus_1.mapKey)(customLevels, function (name) { return ({ name: name, level: customLevels[name] }); });
|
|
36
|
+
}
|
|
37
|
+
exports.getCustomLevels = getCustomLevels;
|
|
38
|
+
//# sourceMappingURL=customLogLevel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customLogLevel.js","sourceRoot":"","sources":["../ts/customLogLevel.ts"],"names":[],"mappings":";;;AAAA,uCAA8C;AAC9C,uCAAkC;AAGlC;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,IAAY,EAAE,KAAa;IACrD,IAAA,KAAwC,gBAAK,CAAC,KAAK,EAAjD,YAAY,kBAAA,EAAE,mBAAmB,yBAAgB,CAAA;IACzD,YAAY,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;IAC1B,mBAAmB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAA;IACzB,IAAA,cAAc,GAAK,gBAAK,CAAC,KAAK,eAAhB,CAAgB;IACtC,IAAA,sBAAU,EAAC,cAAc,EAAE,UAAA,EAAE,IAAI,OAAA,cAAc,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,EAAzC,CAAyC,CAAC,CAAA;AAC7E,CAAC;AAND,8CAMC;AAED,SAAgB,mBAAmB;IAC3B,IAAA,KAAwC,gBAAK,CAAC,KAAK,EAAjD,YAAY,kBAAA,EAAE,mBAAmB,yBAAgB,CAAA;IACzD,8DAA8D;IAC9D,IAAA,sBAAU,EAAC,YAAY,EAAE,UAAA,CAAC,IAAI,OAAA,OAAO,YAAY,CAAC,CAAC,CAAC,EAAtB,CAAsB,CAAC,CAAA;IACrD,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAA;AAC3D,CAAC;AALD,kDAKC;AAED,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,gBAAK,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AACvC,CAAC;AAFD,wCAEC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,gBAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;AAC/C,CAAC;AAFD,gDAEC;AAED,SAAgB,eAAe;IACrB,IAAA,YAAY,GAAK,gBAAK,CAAC,KAAK,aAAhB,CAAgB;IACpC,OAAO,IAAA,kBAAM,EAAC,YAAY,EAAE,UAAA,IAAI,IAAI,OAAA,CAAC,EAAE,IAAI,MAAA,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAArC,CAAqC,CAAC,CAAA;AAC5E,CAAC;AAHD,0CAGC","sourcesContent":["import { forEachKey, mapKey } from 'type-plus'\nimport { store } from './store.js'\nimport { LogLevelEntry } from './types.js'\n\n/**\n * @param level the `logLevel` number.\n * You can specify this in the form of `logLevel.<x> + n` to make it more readable.\n */\nexport function addCustomLogLevel(name: string, level: number) {\n const { customLevels, customLevelsReverse } = store.value\n customLevels[name] = level\n customLevelsReverse[level] = name\n const { loggerClosures } = store.value\n forEachKey(loggerClosures, id => loggerClosures[id].addMethod(name, level))\n}\n\nexport function clearCustomLogLevel() {\n const { customLevels, customLevelsReverse } = store.value\n // Don't replace the object would prevent reference divergence\n forEachKey(customLevels, k => delete customLevels[k])\n customLevelsReverse.splice(0, customLevelsReverse.length)\n}\n\nexport function getCustomLevel(name: string): number | undefined {\n return store.value.customLevels[name]\n}\n\nexport function getCustomLevelName(level: number): string | undefined {\n return store.value.customLevelsReverse[level]\n}\n\nexport function getCustomLevels(): LogLevelEntry[] {\n const { customLevels } = store.value\n return mapKey(customLevels, name => ({ name, level: customLevels[name] }))\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customLogLevel.spec.d.ts","sourceRoot":"","sources":["../ts/customLogLevel.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var assertron_1 = __importDefault(require("assertron"));
|
|
7
|
+
var index_js_1 = require("./index.js");
|
|
8
|
+
var config_js_1 = require("./config.js");
|
|
9
|
+
var index_js_2 = require("./memory/index.js");
|
|
10
|
+
var store_js_1 = require("./store.js");
|
|
11
|
+
afterEach(function () { return store_js_1.store.reset(); });
|
|
12
|
+
describe('clearCustomLogLevel()', function () {
|
|
13
|
+
test('clear all custom levels', function () {
|
|
14
|
+
(0, index_js_1.addCustomLogLevel)('c1', index_js_1.logLevels.none + 1);
|
|
15
|
+
(0, index_js_1.addCustomLogLevel)('c2', index_js_1.logLevels.none + 2);
|
|
16
|
+
expect((0, index_js_1.getCustomLevels)().length).toBe(2);
|
|
17
|
+
(0, index_js_1.clearCustomLogLevel)();
|
|
18
|
+
expect((0, index_js_1.getCustomLevels)().length).toBe(0);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
test('custom level will not write if log level is lower', function () {
|
|
22
|
+
var memReporter = (0, index_js_2.createMemoryLogReporter)();
|
|
23
|
+
(0, config_js_1.config)({
|
|
24
|
+
mode: 'test',
|
|
25
|
+
reporters: [memReporter]
|
|
26
|
+
});
|
|
27
|
+
(0, index_js_1.addCustomLogLevel)('c1', index_js_1.logLevels.debug + 1);
|
|
28
|
+
var log = (0, index_js_1.getLogger)('custom-level-not-write');
|
|
29
|
+
log.c1('will not write this');
|
|
30
|
+
expect(memReporter.logs.length).toEqual(0);
|
|
31
|
+
});
|
|
32
|
+
test('custom level method is readonly', function () {
|
|
33
|
+
(0, index_js_1.addCustomLogLevel)('c1', index_js_1.logLevels.debug + 1);
|
|
34
|
+
var log = (0, index_js_1.getLogger)('custom method readonly');
|
|
35
|
+
assertron_1.default.throws(function () { log.c1 = function () { }; });
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=customLogLevel.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customLogLevel.spec.js","sourceRoot":"","sources":["../ts/customLogLevel.spec.ts"],"names":[],"mappings":";;;;;AAAA,wDAAyB;AACzB,uCAA0G;AAC1G,yCAAoC;AACpC,8CAA2D;AAC3D,uCAAkC;AAElC,SAAS,CAAC,cAAM,OAAA,gBAAK,CAAC,KAAK,EAAE,EAAb,CAAa,CAAC,CAAA;AAE9B,QAAQ,CAAC,uBAAuB,EAAE;IAChC,IAAI,CAAC,yBAAyB,EAAE;QAC9B,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA;QAC3C,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA;QAC3C,MAAM,CAAC,IAAA,0BAAe,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAExC,IAAA,8BAAmB,GAAE,CAAA;QAErB,MAAM,CAAC,IAAA,0BAAe,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mDAAmD,EAAE;IACxD,IAAM,WAAW,GAAG,IAAA,kCAAuB,GAAE,CAAA;IAC7C,IAAA,kBAAM,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,CAAC,WAAW,CAAC;KACzB,CAAC,CAAA;IAEF,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAC5C,IAAM,GAAG,GAAG,IAAA,oBAAS,EAAO,wBAAwB,CAAC,CAAA;IACrD,GAAG,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAA;IAE7B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,iCAAiC,EAAE;IACtC,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAC5C,IAAM,GAAG,GAAG,IAAA,oBAAS,EAAO,wBAAwB,CAAC,CAAA;IACrD,mBAAC,CAAC,MAAM,CAAC,cAAQ,GAAG,CAAC,EAAE,GAAG,cAAQ,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC,CAAC,CAAA","sourcesContent":["import a from 'assertron'\nimport { addCustomLogLevel, clearCustomLogLevel, getCustomLevels, getLogger, logLevels } from './index.js'\nimport { config } from './config.js'\nimport { createMemoryLogReporter } from './memory/index.js'\nimport { store } from './store.js'\n\nafterEach(() => store.reset())\n\ndescribe('clearCustomLogLevel()', () => {\n test('clear all custom levels', () => {\n addCustomLogLevel('c1', logLevels.none + 1)\n addCustomLogLevel('c2', logLevels.none + 2)\n expect(getCustomLevels().length).toBe(2)\n\n clearCustomLogLevel()\n\n expect(getCustomLevels().length).toBe(0)\n })\n})\n\ntest('custom level will not write if log level is lower', () => {\n const memReporter = createMemoryLogReporter()\n config({\n mode: 'test',\n reporters: [memReporter]\n })\n\n addCustomLogLevel('c1', logLevels.debug + 1)\n const log = getLogger<'c1'>('custom-level-not-write')\n log.c1('will not write this')\n\n expect(memReporter.logs.length).toEqual(0)\n})\n\ntest('custom level method is readonly', () => {\n addCustomLogLevel('c1', logLevels.debug + 1)\n const log = getLogger<'c1'>('custom method readonly')\n a.throws(() => { log.c1 = () => { } })\n})\n"]}
|
package/{lib → cjs}/errors.d.ts
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEjD,qBAAa,gBAAiB,SAAQ,WAAW;gBACnC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO;CAG5D;AACD,qBAAa,SAAU,SAAQ,gBAAgB;IAC1B,EAAE,EAAE,MAAM;gBAAV,EAAE,EAAE,MAAM;CAG9B;AAED,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC3C,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAGlC;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IAC9B,IAAI,EAAE,MAAM;IAAS,KAAK,EAAE,MAAM;IAAS,cAAc,EAAE,MAAM,EAAE;gBAAnE,IAAI,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,cAAc,EAAE,MAAM,EAAE;CAGvF"}
|