standard-log 12.1.1 → 12.1.2
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/cjs/standard_log.testing.d.ts +1 -1
- package/cjs/standard_log.testing.js.map +1 -1
- package/dist/standard-log.es5.js +640 -661
- 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 +72 -89
- 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/esm/standard_log.testing.d.ts +1 -1
- package/esm/standard_log.testing.js.map +1 -1
- package/package.json +2 -2
- package/ts/standard_log.testing.ts +1 -1
|
@@ -3,7 +3,7 @@ import { type StandardLog } from './standard_log.js';
|
|
|
3
3
|
import type { LogMethodNames, StandardLogOptions } from './types.js';
|
|
4
4
|
export type StandardLogForTestOptions<N extends string = LogMethodNames> = StandardLogOptions<N> & {
|
|
5
5
|
/**
|
|
6
|
-
* Send the logs to console
|
|
6
|
+
* Send the logs to console for easy debugging.
|
|
7
7
|
*
|
|
8
8
|
* @default false
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard_log.testing.js","sourceRoot":"","sources":["../ts/standard_log.testing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAAuD;AACvD,iDAA2C;AAC3C,yCAA6E;AAC7E,qDAA8E;AAgB9E,SAAgB,wBAAwB,CACvC,OAA0C;;IAA1C,wBAAA,EAAA,YAA0C;IAE1C,OAAO,CAAC,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,yBAAS,CAAC,KAAK,CAAA;IACtD,OAAO,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,EAAE,CAAA;IAE3C,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,iBAAiB,EAAnB,CAAmB,CAAC,EAAE;QACzE,8BAA8B;QAC9B,oCAAoC;QACpC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAA,qCAAwB,GAAE,CAAC,CAAA;KAClD;IAED,IAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,KAAK,QAAQ,EAAjB,CAAiB,CAAsB,CAAA;IAC5F,IAAM,QAAQ,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAA,mCAAuB,GAAE,CAAA;IAC9D,IAAI,CAAC,gBAAgB,EAAE;QACtB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;KAChC;IACD,IAAM,OAAO,GAAG,IAAA,0CAAwB,EAAI,OAAO,CAAC,CAAA;IACpD,6BAAY,OAAO,CAAC,WAAW,KAAE,QAAQ,UAAA,IAAE;AAC5C,CAAC;AAnBD,4DAmBC","sourcesContent":["import { createConsoleLogReporter } from './console.js'\nimport { logLevels } from './log_levels.js'\nimport { createMemoryLogReporter, type MemoryLogReporter } from './memory.js'\nimport { createStandardLogClosure, type StandardLog } from './standard_log.js'\nimport type { LogMethodNames, StandardLogOptions } from './types.js'\n\nexport type StandardLogForTestOptions<N extends string = LogMethodNames> = StandardLogOptions<N> & {\n\t/**\n\t * Send the logs to console
|
|
1
|
+
{"version":3,"file":"standard_log.testing.js","sourceRoot":"","sources":["../ts/standard_log.testing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAAuD;AACvD,iDAA2C;AAC3C,yCAA6E;AAC7E,qDAA8E;AAgB9E,SAAgB,wBAAwB,CACvC,OAA0C;;IAA1C,wBAAA,EAAA,YAA0C;IAE1C,OAAO,CAAC,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,yBAAS,CAAC,KAAK,CAAA;IACtD,OAAO,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,EAAE,CAAA;IAE3C,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,iBAAiB,EAAnB,CAAmB,CAAC,EAAE;QACzE,8BAA8B;QAC9B,oCAAoC;QACpC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAA,qCAAwB,GAAE,CAAC,CAAA;KAClD;IAED,IAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,KAAK,QAAQ,EAAjB,CAAiB,CAAsB,CAAA;IAC5F,IAAM,QAAQ,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,IAAA,mCAAuB,GAAE,CAAA;IAC9D,IAAI,CAAC,gBAAgB,EAAE;QACtB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;KAChC;IACD,IAAM,OAAO,GAAG,IAAA,0CAAwB,EAAI,OAAO,CAAC,CAAA;IACpD,6BAAY,OAAO,CAAC,WAAW,KAAE,QAAQ,UAAA,IAAE;AAC5C,CAAC;AAnBD,4DAmBC","sourcesContent":["import { createConsoleLogReporter } from './console.js'\nimport { logLevels } from './log_levels.js'\nimport { createMemoryLogReporter, type MemoryLogReporter } from './memory.js'\nimport { createStandardLogClosure, type StandardLog } from './standard_log.js'\nimport type { LogMethodNames, StandardLogOptions } from './types.js'\n\nexport type StandardLogForTestOptions<N extends string = LogMethodNames> = StandardLogOptions<N> & {\n\t/**\n\t * Send the logs to console for easy debugging.\n\t *\n\t * @default false\n\t */\n\temitLog?: boolean\n}\n\nexport type StandardLogForTest<N extends string = LogMethodNames> = StandardLog<N> & {\n\treporter: MemoryLogReporter\n}\n\nexport function createStandardLogForTest<N extends string = LogMethodNames>(\n\toptions: StandardLogForTestOptions<N> = {}\n): StandardLogForTest<N> {\n\toptions.logLevel = options.logLevel ?? logLevels.debug\n\toptions.reporters = options.reporters ?? []\n\n\tif (options.emitLog && !options.reporters.some(r => r.isConsoleReporter)) {\n\t\t// this is used for debugging,\n\t\t// so no need to use color reporter.\n\t\toptions.reporters.push(createConsoleLogReporter())\n\t}\n\n\tconst existingReporter = options.reporters.find(r => r.id === 'memory') as MemoryLogReporter\n\tconst reporter = existingReporter ?? createMemoryLogReporter()\n\tif (!existingReporter) {\n\t\toptions.reporters.push(reporter)\n\t}\n\tconst closure = createStandardLogClosure<N>(options)\n\treturn { ...closure.standardLog, reporter }\n}\n"]}
|