@vibesdotdev/logging 0.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 +80 -0
- package/SPEC.md +65 -0
- package/dist/audit/audit.descriptor.d.ts +11 -0
- package/dist/audit/audit.descriptor.d.ts.map +1 -0
- package/dist/audit/audit.descriptor.js +40 -0
- package/dist/audit/audit.descriptor.js.map +1 -0
- package/dist/audit/audit.storage.schema.d.ts +79 -0
- package/dist/audit/audit.storage.schema.d.ts.map +1 -0
- package/dist/audit/audit.storage.schema.js +33 -0
- package/dist/audit/audit.storage.schema.js.map +1 -0
- package/dist/audit/index.d.ts +2 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +2 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/cli/logs.descriptor.d.ts +9 -0
- package/dist/cli/logs.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.descriptor.js +16 -0
- package/dist/cli/logs.descriptor.js.map +1 -0
- package/dist/cli/logs.list.descriptor.d.ts +9 -0
- package/dist/cli/logs.list.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.list.descriptor.js +23 -0
- package/dist/cli/logs.list.descriptor.js.map +1 -0
- package/dist/cli/logs.list.impl.d.ts +13 -0
- package/dist/cli/logs.list.impl.d.ts.map +1 -0
- package/dist/cli/logs.list.impl.js +81 -0
- package/dist/cli/logs.list.impl.js.map +1 -0
- package/dist/cli/logs.rotate.descriptor.d.ts +9 -0
- package/dist/cli/logs.rotate.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.rotate.descriptor.js +34 -0
- package/dist/cli/logs.rotate.descriptor.js.map +1 -0
- package/dist/cli/logs.rotate.impl.d.ts +17 -0
- package/dist/cli/logs.rotate.impl.d.ts.map +1 -0
- package/dist/cli/logs.rotate.impl.js +48 -0
- package/dist/cli/logs.rotate.impl.js.map +1 -0
- package/dist/cli/logs.search.descriptor.d.ts +9 -0
- package/dist/cli/logs.search.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.search.descriptor.js +55 -0
- package/dist/cli/logs.search.descriptor.js.map +1 -0
- package/dist/cli/logs.search.impl.d.ts +22 -0
- package/dist/cli/logs.search.impl.d.ts.map +1 -0
- package/dist/cli/logs.search.impl.js +145 -0
- package/dist/cli/logs.search.impl.js.map +1 -0
- package/dist/cli/logs.tail.descriptor.d.ts +9 -0
- package/dist/cli/logs.tail.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.tail.descriptor.js +43 -0
- package/dist/cli/logs.tail.descriptor.js.map +1 -0
- package/dist/cli/logs.tail.impl.d.ts +19 -0
- package/dist/cli/logs.tail.impl.d.ts.map +1 -0
- package/dist/cli/logs.tail.impl.js +78 -0
- package/dist/cli/logs.tail.impl.js.map +1 -0
- package/dist/cli/logs.view.descriptor.d.ts +9 -0
- package/dist/cli/logs.view.descriptor.d.ts.map +1 -0
- package/dist/cli/logs.view.descriptor.js +51 -0
- package/dist/cli/logs.view.descriptor.js.map +1 -0
- package/dist/cli/logs.view.impl.d.ts +21 -0
- package/dist/cli/logs.view.impl.d.ts.map +1 -0
- package/dist/cli/logs.view.impl.js +85 -0
- package/dist/cli/logs.view.impl.js.map +1 -0
- package/dist/cli/types.d.ts +57 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +9 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/contexts/audit.d.ts +34 -0
- package/dist/contexts/audit.d.ts.map +1 -0
- package/dist/contexts/audit.js +13 -0
- package/dist/contexts/audit.js.map +1 -0
- package/dist/contexts/fallback-logger.d.ts +3 -0
- package/dist/contexts/fallback-logger.d.ts.map +1 -0
- package/dist/contexts/fallback-logger.js +67 -0
- package/dist/contexts/fallback-logger.js.map +1 -0
- package/dist/contexts/index.d.ts +8 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +9 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/contexts/logger.d.ts +26 -0
- package/dist/contexts/logger.d.ts.map +1 -0
- package/dist/contexts/logger.js +88 -0
- package/dist/contexts/logger.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +118 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/namespace.d.ts +69 -0
- package/dist/core/namespace.d.ts.map +1 -0
- package/dist/core/namespace.js +136 -0
- package/dist/core/namespace.js.map +1 -0
- package/dist/core/parsing.d.ts +3 -0
- package/dist/core/parsing.d.ts.map +1 -0
- package/dist/core/parsing.js +25 -0
- package/dist/core/parsing.js.map +1 -0
- package/dist/core/types.d.ts +69 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +7 -0
- package/dist/core/types.js.map +1 -0
- package/dist/docs/levels.docs.descriptor.d.ts +4 -0
- package/dist/docs/levels.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/levels.docs.descriptor.js +342 -0
- package/dist/docs/levels.docs.descriptor.js.map +1 -0
- package/dist/docs/structured.docs.descriptor.d.ts +4 -0
- package/dist/docs/structured.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/structured.docs.descriptor.js +442 -0
- package/dist/docs/structured.docs.descriptor.js.map +1 -0
- package/dist/docs/transports.docs.descriptor.d.ts +4 -0
- package/dist/docs/transports.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/transports.docs.descriptor.js +426 -0
- package/dist/docs/transports.docs.descriptor.js.map +1 -0
- package/dist/formatters/index.d.ts +7 -0
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/index.js +8 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/formatters/json/json.formatters.descriptor.d.ts +9 -0
- package/dist/formatters/json/json.formatters.descriptor.d.ts.map +1 -0
- package/dist/formatters/json/json.formatters.descriptor.js +22 -0
- package/dist/formatters/json/json.formatters.descriptor.js.map +1 -0
- package/dist/formatters/json/json.impl.d.ts +22 -0
- package/dist/formatters/json/json.impl.d.ts.map +1 -0
- package/dist/formatters/json/json.impl.js +32 -0
- package/dist/formatters/json/json.impl.js.map +1 -0
- package/dist/formatters/json5/json5.descriptor.d.ts +9 -0
- package/dist/formatters/json5/json5.descriptor.d.ts.map +1 -0
- package/dist/formatters/json5/json5.descriptor.js +22 -0
- package/dist/formatters/json5/json5.descriptor.js.map +1 -0
- package/dist/formatters/json5/json5.impl.d.ts +23 -0
- package/dist/formatters/json5/json5.impl.d.ts.map +1 -0
- package/dist/formatters/json5/json5.impl.js +34 -0
- package/dist/formatters/json5/json5.impl.js.map +1 -0
- package/dist/formatters/jsonl/jsonl.descriptor.d.ts +10 -0
- package/dist/formatters/jsonl/jsonl.descriptor.d.ts.map +1 -0
- package/dist/formatters/jsonl/jsonl.descriptor.js +23 -0
- package/dist/formatters/jsonl/jsonl.descriptor.js.map +1 -0
- package/dist/formatters/jsonl/jsonl.impl.d.ts +21 -0
- package/dist/formatters/jsonl/jsonl.impl.d.ts.map +1 -0
- package/dist/formatters/jsonl/jsonl.impl.js +30 -0
- package/dist/formatters/jsonl/jsonl.impl.js.map +1 -0
- package/dist/formatters/pretty/pretty.descriptor.d.ts +9 -0
- package/dist/formatters/pretty/pretty.descriptor.d.ts.map +1 -0
- package/dist/formatters/pretty/pretty.descriptor.js +23 -0
- package/dist/formatters/pretty/pretty.descriptor.js.map +1 -0
- package/dist/formatters/pretty/pretty.impl.cli.d.ts +23 -0
- package/dist/formatters/pretty/pretty.impl.cli.d.ts.map +1 -0
- package/dist/formatters/pretty/pretty.impl.cli.js +81 -0
- package/dist/formatters/pretty/pretty.impl.cli.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -0
- package/dist/kinds/audit.d.ts +85 -0
- package/dist/kinds/audit.d.ts.map +1 -0
- package/dist/kinds/audit.js +71 -0
- package/dist/kinds/audit.js.map +1 -0
- package/dist/kinds/contexts.d.ts +21 -0
- package/dist/kinds/contexts.d.ts.map +1 -0
- package/dist/kinds/contexts.js +8 -0
- package/dist/kinds/contexts.js.map +1 -0
- package/dist/kinds/formatter.d.ts +42 -0
- package/dist/kinds/formatter.d.ts.map +1 -0
- package/dist/kinds/formatter.js +69 -0
- package/dist/kinds/formatter.js.map +1 -0
- package/dist/kinds/index.d.ts +13 -0
- package/dist/kinds/index.d.ts.map +1 -0
- package/dist/kinds/index.js +13 -0
- package/dist/kinds/index.js.map +1 -0
- package/dist/kinds/logger.contracts.d.ts +16 -0
- package/dist/kinds/logger.contracts.d.ts.map +1 -0
- package/dist/kinds/logger.contracts.js +9 -0
- package/dist/kinds/logger.contracts.js.map +1 -0
- package/dist/kinds/logger.d.ts +15 -0
- package/dist/kinds/logger.d.ts.map +1 -0
- package/dist/kinds/logger.impl.d.ts +40 -0
- package/dist/kinds/logger.impl.d.ts.map +1 -0
- package/dist/kinds/logger.impl.js +139 -0
- package/dist/kinds/logger.impl.js.map +1 -0
- package/dist/kinds/logger.js +28 -0
- package/dist/kinds/logger.js.map +1 -0
- package/dist/kinds/logger.utils.d.ts +15 -0
- package/dist/kinds/logger.utils.d.ts.map +1 -0
- package/dist/kinds/logger.utils.js +55 -0
- package/dist/kinds/logger.utils.js.map +1 -0
- package/dist/kinds/output.contracts.d.ts +50 -0
- package/dist/kinds/output.contracts.d.ts.map +1 -0
- package/dist/kinds/output.contracts.js +10 -0
- package/dist/kinds/output.contracts.js.map +1 -0
- package/dist/kinds/output.d.ts +20 -0
- package/dist/kinds/output.d.ts.map +1 -0
- package/dist/kinds/output.impl.d.ts +22 -0
- package/dist/kinds/output.impl.d.ts.map +1 -0
- package/dist/kinds/output.impl.js +84 -0
- package/dist/kinds/output.impl.js.map +1 -0
- package/dist/kinds/output.js +29 -0
- package/dist/kinds/output.js.map +1 -0
- package/dist/kinds/output.types.d.ts +92 -0
- package/dist/kinds/output.types.d.ts.map +1 -0
- package/dist/kinds/output.types.js +7 -0
- package/dist/kinds/output.types.js.map +1 -0
- package/dist/kinds/sink.d.ts +40 -0
- package/dist/kinds/sink.d.ts.map +1 -0
- package/dist/kinds/sink.js +61 -0
- package/dist/kinds/sink.js.map +1 -0
- package/dist/logger.context.descriptor.d.ts +21 -0
- package/dist/logger.context.descriptor.d.ts.map +1 -0
- package/dist/logger.context.descriptor.js +12 -0
- package/dist/logger.context.descriptor.js.map +1 -0
- package/dist/logging.cli.plugin.d.ts +20 -0
- package/dist/logging.cli.plugin.d.ts.map +1 -0
- package/dist/logging.cli.plugin.js +39 -0
- package/dist/logging.cli.plugin.js.map +1 -0
- package/dist/logging.plugin.d.ts +16 -0
- package/dist/logging.plugin.d.ts.map +1 -0
- package/dist/logging.plugin.js +83 -0
- package/dist/logging.plugin.js.map +1 -0
- package/dist/outputs/index.d.ts +7 -0
- package/dist/outputs/index.d.ts.map +1 -0
- package/dist/outputs/index.js +8 -0
- package/dist/outputs/index.js.map +1 -0
- package/dist/outputs/remote/remote.descriptor.d.ts +10 -0
- package/dist/outputs/remote/remote.descriptor.d.ts.map +1 -0
- package/dist/outputs/remote/remote.descriptor.js +24 -0
- package/dist/outputs/remote/remote.descriptor.js.map +1 -0
- package/dist/outputs/remote/remote.impl.d.ts +50 -0
- package/dist/outputs/remote/remote.impl.d.ts.map +1 -0
- package/dist/outputs/remote/remote.impl.js +178 -0
- package/dist/outputs/remote/remote.impl.js.map +1 -0
- package/dist/outputs.context.descriptor.d.ts +19 -0
- package/dist/outputs.context.descriptor.d.ts.map +1 -0
- package/dist/outputs.context.descriptor.js +9 -0
- package/dist/outputs.context.descriptor.js.map +1 -0
- package/dist/outputs.context.impl.d.ts +9 -0
- package/dist/outputs.context.impl.d.ts.map +1 -0
- package/dist/outputs.context.impl.js +18 -0
- package/dist/outputs.context.impl.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +10 -0
- package/dist/paths.js.map +1 -0
- package/dist/schemas/audit.d.ts +133 -0
- package/dist/schemas/audit.d.ts.map +1 -0
- package/dist/schemas/audit.js +80 -0
- package/dist/schemas/audit.js.map +1 -0
- package/dist/schemas/entry.d.ts +74 -0
- package/dist/schemas/entry.d.ts.map +1 -0
- package/dist/schemas/entry.js +62 -0
- package/dist/schemas/entry.js.map +1 -0
- package/dist/schemas/formatter.d.ts +46 -0
- package/dist/schemas/formatter.d.ts.map +1 -0
- package/dist/schemas/formatter.js +31 -0
- package/dist/schemas/formatter.js.map +1 -0
- package/dist/schemas/index.d.ts +12 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +18 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/logger.d.ts +48 -0
- package/dist/schemas/logger.d.ts.map +1 -0
- package/dist/schemas/logger.js +27 -0
- package/dist/schemas/logger.js.map +1 -0
- package/dist/schemas/output.d.ts +68 -0
- package/dist/schemas/output.d.ts.map +1 -0
- package/dist/schemas/output.js +48 -0
- package/dist/schemas/output.js.map +1 -0
- package/dist/schemas/sink.d.ts +52 -0
- package/dist/schemas/sink.d.ts.map +1 -0
- package/dist/schemas/sink.js +30 -0
- package/dist/schemas/sink.js.map +1 -0
- package/dist/sinks/buffer/buffer.descriptor.d.ts +4 -0
- package/dist/sinks/buffer/buffer.descriptor.d.ts.map +1 -0
- package/dist/sinks/buffer/buffer.descriptor.js +11 -0
- package/dist/sinks/buffer/buffer.descriptor.js.map +1 -0
- package/dist/sinks/buffer/buffer.impl.cli.d.ts +21 -0
- package/dist/sinks/buffer/buffer.impl.cli.d.ts.map +1 -0
- package/dist/sinks/buffer/buffer.impl.cli.js +34 -0
- package/dist/sinks/buffer/buffer.impl.cli.js.map +1 -0
- package/dist/sinks/console/console.descriptor.d.ts +10 -0
- package/dist/sinks/console/console.descriptor.d.ts.map +1 -0
- package/dist/sinks/console/console.descriptor.js +17 -0
- package/dist/sinks/console/console.descriptor.js.map +1 -0
- package/dist/sinks/console/console.impl.browser.d.ts +21 -0
- package/dist/sinks/console/console.impl.browser.d.ts.map +1 -0
- package/dist/sinks/console/console.impl.browser.js +57 -0
- package/dist/sinks/console/console.impl.browser.js.map +1 -0
- package/dist/sinks/console/console.impl.cli.d.ts +21 -0
- package/dist/sinks/console/console.impl.cli.d.ts.map +1 -0
- package/dist/sinks/console/console.impl.cli.js +57 -0
- package/dist/sinks/console/console.impl.cli.js.map +1 -0
- package/dist/sinks/index.d.ts +8 -0
- package/dist/sinks/index.d.ts.map +1 -0
- package/dist/sinks/index.js +8 -0
- package/dist/sinks/index.js.map +1 -0
- package/dist/sinks/memory/memory.descriptor.d.ts +10 -0
- package/dist/sinks/memory/memory.descriptor.d.ts.map +1 -0
- package/dist/sinks/memory/memory.descriptor.js +17 -0
- package/dist/sinks/memory/memory.descriptor.js.map +1 -0
- package/dist/sinks/memory/memory.impl.d.ts +50 -0
- package/dist/sinks/memory/memory.impl.d.ts.map +1 -0
- package/dist/sinks/memory/memory.impl.js +88 -0
- package/dist/sinks/memory/memory.impl.js.map +1 -0
- package/dist/sinks/stdout/stdout.descriptor.d.ts +4 -0
- package/dist/sinks/stdout/stdout.descriptor.d.ts.map +1 -0
- package/dist/sinks/stdout/stdout.descriptor.js +11 -0
- package/dist/sinks/stdout/stdout.descriptor.js.map +1 -0
- package/dist/sinks/stdout/stdout.impl.cli.d.ts +10 -0
- package/dist/sinks/stdout/stdout.impl.cli.d.ts.map +1 -0
- package/dist/sinks/stdout/stdout.impl.cli.js +21 -0
- package/dist/sinks/stdout/stdout.impl.cli.js.map +1 -0
- package/dist/sinks.context.descriptor.d.ts +19 -0
- package/dist/sinks.context.descriptor.d.ts.map +1 -0
- package/dist/sinks.context.descriptor.js +9 -0
- package/dist/sinks.context.descriptor.js.map +1 -0
- package/dist/sinks.context.impl.d.ts +9 -0
- package/dist/sinks.context.impl.d.ts.map +1 -0
- package/dist/sinks.context.impl.js +18 -0
- package/dist/sinks.context.impl.js.map +1 -0
- package/package.json +331 -0
- package/src/audit/audit.descriptor.ts +45 -0
- package/src/audit/audit.storage.schema.ts +57 -0
- package/src/audit/index.ts +8 -0
- package/src/cli/logs.descriptor.ts +19 -0
- package/src/cli/logs.list.descriptor.ts +28 -0
- package/src/cli/logs.list.impl.ts +93 -0
- package/src/cli/logs.rotate.descriptor.ts +40 -0
- package/src/cli/logs.rotate.impl.ts +61 -0
- package/src/cli/logs.search.descriptor.ts +61 -0
- package/src/cli/logs.search.impl.ts +173 -0
- package/src/cli/logs.tail.descriptor.ts +49 -0
- package/src/cli/logs.tail.impl.ts +105 -0
- package/src/cli/logs.view.descriptor.ts +57 -0
- package/src/cli/logs.view.impl.ts +108 -0
- package/src/cli/types.ts +59 -0
- package/src/contexts/audit.ts +36 -0
- package/src/contexts/fallback-logger.ts +80 -0
- package/src/contexts/index.ts +23 -0
- package/src/contexts/logger.ts +119 -0
- package/src/core/index.ts +32 -0
- package/src/core/logger.ts +150 -0
- package/src/core/namespace.ts +195 -0
- package/src/core/parsing.ts +21 -0
- package/src/core/types.ts +82 -0
- package/src/docs/levels.docs.descriptor.ts +344 -0
- package/src/docs/structured.docs.descriptor.ts +444 -0
- package/src/docs/transports.docs.descriptor.ts +428 -0
- package/src/formatters/index.ts +6 -0
- package/src/formatters/json/json.formatters.descriptor.ts +25 -0
- package/src/formatters/json/json.impl.ts +41 -0
- package/src/formatters/json5/json5.descriptor.ts +25 -0
- package/src/formatters/json5/json5.impl.ts +43 -0
- package/src/formatters/jsonl/jsonl.descriptor.ts +26 -0
- package/src/formatters/jsonl/jsonl.impl.ts +39 -0
- package/src/formatters/pretty/pretty.descriptor.ts +26 -0
- package/src/formatters/pretty/pretty.impl.cli.ts +101 -0
- package/src/index.ts +190 -0
- package/src/kinds/audit.ts +169 -0
- package/src/kinds/contexts.ts +22 -0
- package/src/kinds/formatter.ts +117 -0
- package/src/kinds/index.ts +25 -0
- package/src/kinds/logger.contracts.ts +17 -0
- package/src/kinds/logger.impl.ts +206 -0
- package/src/kinds/logger.ts +46 -0
- package/src/kinds/logger.utils.ts +91 -0
- package/src/kinds/output.contracts.ts +54 -0
- package/src/kinds/output.impl.ts +118 -0
- package/src/kinds/output.ts +59 -0
- package/src/kinds/output.types.ts +105 -0
- package/src/kinds/sink.ts +100 -0
- package/src/logger.context.descriptor.ts +13 -0
- package/src/logging.cli.plugin.ts +43 -0
- package/src/logging.plugin.ts +93 -0
- package/src/outputs/index.ts +6 -0
- package/src/outputs/remote/remote.descriptor.ts +27 -0
- package/src/outputs/remote/remote.impl.ts +218 -0
- package/src/outputs.context.descriptor.ts +10 -0
- package/src/outputs.context.impl.ts +30 -0
- package/src/paths.ts +10 -0
- package/src/schemas/audit.ts +98 -0
- package/src/schemas/entry.ts +88 -0
- package/src/schemas/formatter.ts +37 -0
- package/src/schemas/index.ts +80 -0
- package/src/schemas/logger.ts +38 -0
- package/src/schemas/output.ts +62 -0
- package/src/schemas/sink.ts +39 -0
- package/src/sinks/buffer/buffer.descriptor.ts +13 -0
- package/src/sinks/buffer/buffer.impl.cli.ts +49 -0
- package/src/sinks/console/console.descriptor.ts +20 -0
- package/src/sinks/console/console.impl.browser.ts +69 -0
- package/src/sinks/console/console.impl.cli.ts +71 -0
- package/src/sinks/index.ts +8 -0
- package/src/sinks/memory/memory.descriptor.ts +20 -0
- package/src/sinks/memory/memory.impl.ts +119 -0
- package/src/sinks/stdout/stdout.descriptor.ts +13 -0
- package/src/sinks/stdout/stdout.impl.cli.ts +27 -0
- package/src/sinks.context.descriptor.ts +10 -0
- package/src/sinks.context.impl.ts +30 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSONL Formatter Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Formats log entries as newline-delimited JSON.
|
|
5
|
+
* Default formatter for file outputs.
|
|
6
|
+
*/
|
|
7
|
+
export const jsonlFormatterDescriptor = {
|
|
8
|
+
kind: 'logging/formatter',
|
|
9
|
+
id: 'jsonl',
|
|
10
|
+
name: 'JSONL Formatter',
|
|
11
|
+
description: 'Formats log entries as newline-delimited JSON',
|
|
12
|
+
tags: ['default', 'file', 'streaming'],
|
|
13
|
+
format: 'jsonl',
|
|
14
|
+
options: {
|
|
15
|
+
indent: 0,
|
|
16
|
+
includeTimestamp: true,
|
|
17
|
+
includeNamespace: true,
|
|
18
|
+
includeLevel: true,
|
|
19
|
+
colors: false
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default jsonlFormatterDescriptor;
|
|
23
|
+
//# sourceMappingURL=jsonl.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl.descriptor.js","sourceRoot":"","sources":["../../../src/formatters/jsonl/jsonl.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IAC5D,IAAI,EAAE,mBAAmB;IACzB,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IACtC,MAAM,EAAE,OAAO;IACf,OAAO,EAAE;QACR,MAAM,EAAE,CAAC;QACT,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,IAAI;QACtB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,KAAK;KACb;CACD,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSONL Formatter Implementation
|
|
3
|
+
*
|
|
4
|
+
* Uses Bun's native JSON serialization for performance.
|
|
5
|
+
*/
|
|
6
|
+
import type { FormatterImplementation, FormatterContext } from '../../kinds/formatter.ts';
|
|
7
|
+
import type { FormatterDescriptor } from '../../schemas/formatter.ts';
|
|
8
|
+
import type { RuntimeLogEntry } from '../../schemas/entry.ts';
|
|
9
|
+
/**
|
|
10
|
+
* JSONL formatter - one JSON object per line.
|
|
11
|
+
*/
|
|
12
|
+
export default class JsonlFormatter implements FormatterImplementation {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly descriptor: FormatterDescriptor;
|
|
15
|
+
constructor(descriptor: FormatterDescriptor, _context: FormatterContext);
|
|
16
|
+
format(entry: RuntimeLogEntry): string;
|
|
17
|
+
parse(formatted: string): RuntimeLogEntry;
|
|
18
|
+
formatBatch(entries: RuntimeLogEntry[]): string;
|
|
19
|
+
parseBatch(formatted: string): RuntimeLogEntry[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=jsonl.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl.impl.d.ts","sourceRoot":"","sources":["../../../src/formatters/jsonl/jsonl.impl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,uBAAuB;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;gBAE7B,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB;IAKvE,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM;IAItC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe;IAIzC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM;IAI/C,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,EAAE;CAIhD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSONL Formatter Implementation
|
|
3
|
+
*
|
|
4
|
+
* Uses Bun's native JSON serialization for performance.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* JSONL formatter - one JSON object per line.
|
|
8
|
+
*/
|
|
9
|
+
export default class JsonlFormatter {
|
|
10
|
+
id;
|
|
11
|
+
descriptor;
|
|
12
|
+
constructor(descriptor, _context) {
|
|
13
|
+
this.id = descriptor.id;
|
|
14
|
+
this.descriptor = descriptor;
|
|
15
|
+
}
|
|
16
|
+
format(entry) {
|
|
17
|
+
return JSON.stringify(entry);
|
|
18
|
+
}
|
|
19
|
+
parse(formatted) {
|
|
20
|
+
return JSON.parse(formatted);
|
|
21
|
+
}
|
|
22
|
+
formatBatch(entries) {
|
|
23
|
+
return entries.map((e) => JSON.stringify(e)).join('\n');
|
|
24
|
+
}
|
|
25
|
+
parseBatch(formatted) {
|
|
26
|
+
const lines = formatted.split('\n').filter((line) => line.trim());
|
|
27
|
+
return lines.map((line) => JSON.parse(line));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=jsonl.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl.impl.js","sourceRoot":"","sources":["../../../src/formatters/jsonl/jsonl.impl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IACzB,EAAE,CAAS;IACX,UAAU,CAAsB;IAEzC,YAAY,UAA+B,EAAE,QAA0B;QACtE,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,KAAsB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAoB,CAAC;IACjD,CAAC;IAED,WAAW,CAAC,OAA0B;QACrC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;IAED,UAAU,CAAC,SAAiB;QAC3B,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAoB,CAAC,CAAC;IACjE,CAAC;CACD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pretty Formatter Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Colorized, human-readable output for CLI/TUI.
|
|
5
|
+
*/
|
|
6
|
+
import type { FormatterDescriptor } from '../../schemas/formatter.ts';
|
|
7
|
+
export declare const prettyFormatterDescriptor: FormatterDescriptor;
|
|
8
|
+
export default prettyFormatterDescriptor;
|
|
9
|
+
//# sourceMappingURL=pretty.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty.descriptor.d.ts","sourceRoot":"","sources":["../../../src/formatters/pretty/pretty.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,eAAO,MAAM,yBAAyB,EAAE,mBAevC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pretty Formatter Descriptor
|
|
3
|
+
*
|
|
4
|
+
* Colorized, human-readable output for CLI/TUI.
|
|
5
|
+
*/
|
|
6
|
+
export const prettyFormatterDescriptor = {
|
|
7
|
+
kind: 'logging/formatter',
|
|
8
|
+
id: 'pretty',
|
|
9
|
+
name: 'Pretty Formatter',
|
|
10
|
+
description: 'Colorized, human-readable output for CLI/TUI',
|
|
11
|
+
tags: ['cli', 'tui', 'readable'],
|
|
12
|
+
hardware: ['consumer'],
|
|
13
|
+
format: 'pretty',
|
|
14
|
+
options: {
|
|
15
|
+
indent: 0,
|
|
16
|
+
includeTimestamp: true,
|
|
17
|
+
includeNamespace: true,
|
|
18
|
+
includeLevel: true,
|
|
19
|
+
colors: true
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default prettyFormatterDescriptor;
|
|
23
|
+
//# sourceMappingURL=pretty.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty.descriptor.js","sourceRoot":"","sources":["../../../src/formatters/pretty/pretty.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAwB;IAC7D,IAAI,EAAE,mBAAmB;IACzB,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,8CAA8C;IAC3D,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;IAChC,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE;QACR,MAAM,EAAE,CAAC;QACT,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,IAAI;QACtB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,IAAI;KACZ;CACD,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pretty Formatter Implementation (CLI)
|
|
3
|
+
*
|
|
4
|
+
* Colorized output using ansis for terminal display.
|
|
5
|
+
*/
|
|
6
|
+
import type { FormatterImplementation, FormatterContext } from '../../kinds/formatter.ts';
|
|
7
|
+
import type { FormatterDescriptor } from '../../schemas/formatter.ts';
|
|
8
|
+
import type { RuntimeLogEntry } from '../../schemas/entry.ts';
|
|
9
|
+
/**
|
|
10
|
+
* Pretty formatter - colorized CLI output.
|
|
11
|
+
*/
|
|
12
|
+
export default class PrettyFormatter implements FormatterImplementation {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly descriptor: FormatterDescriptor;
|
|
15
|
+
private readonly useColors;
|
|
16
|
+
private readonly includeTimestamp;
|
|
17
|
+
constructor(descriptor: FormatterDescriptor, _context: FormatterContext);
|
|
18
|
+
format(entry: RuntimeLogEntry): string;
|
|
19
|
+
parse(formatted: string): RuntimeLogEntry;
|
|
20
|
+
formatBatch(entries: RuntimeLogEntry[]): string;
|
|
21
|
+
parseBatch(formatted: string): RuntimeLogEntry[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=pretty.impl.cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty.impl.cli.d.ts","sourceRoot":"","sources":["../../../src/formatters/pretty/pretty.impl.cli.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,wBAAwB,CAAC;AAmBxE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,uBAAuB;IACtE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAE/B,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB;IAOvE,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM;IAsCtC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe;IAYzC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM;IAI/C,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,EAAE;CAGhD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pretty Formatter Implementation (CLI)
|
|
3
|
+
*
|
|
4
|
+
* Colorized output using ansis for terminal display.
|
|
5
|
+
*/
|
|
6
|
+
import ansis from 'ansis';
|
|
7
|
+
/** Level colors */
|
|
8
|
+
const LEVEL_COLORS = {
|
|
9
|
+
debug: (t) => ansis.gray(t),
|
|
10
|
+
info: (t) => ansis.blue(t),
|
|
11
|
+
warn: (t) => ansis.yellow(t),
|
|
12
|
+
error: (t) => ansis.red(t)
|
|
13
|
+
};
|
|
14
|
+
/** Level symbols */
|
|
15
|
+
const LEVEL_SYMBOLS = {
|
|
16
|
+
debug: '·',
|
|
17
|
+
info: '●',
|
|
18
|
+
warn: '▲',
|
|
19
|
+
error: '✖'
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Pretty formatter - colorized CLI output.
|
|
23
|
+
*/
|
|
24
|
+
export default class PrettyFormatter {
|
|
25
|
+
id;
|
|
26
|
+
descriptor;
|
|
27
|
+
useColors;
|
|
28
|
+
includeTimestamp;
|
|
29
|
+
constructor(descriptor, _context) {
|
|
30
|
+
this.id = descriptor.id;
|
|
31
|
+
this.descriptor = descriptor;
|
|
32
|
+
this.useColors = descriptor.options?.colors ?? true;
|
|
33
|
+
this.includeTimestamp = descriptor.options?.includeTimestamp ?? true;
|
|
34
|
+
}
|
|
35
|
+
format(entry) {
|
|
36
|
+
const { level, namespace, message, timestamp, context } = entry;
|
|
37
|
+
const colorFn = this.useColors ? LEVEL_COLORS[level] : (t) => t;
|
|
38
|
+
const symbol = LEVEL_SYMBOLS[level];
|
|
39
|
+
const parts = [];
|
|
40
|
+
// Timestamp
|
|
41
|
+
if (this.includeTimestamp) {
|
|
42
|
+
const time = new Date(timestamp).toLocaleTimeString('en-US', { hour12: false });
|
|
43
|
+
parts.push(this.useColors ? ansis.dim(time) : time);
|
|
44
|
+
}
|
|
45
|
+
// Level symbol
|
|
46
|
+
parts.push(colorFn(symbol));
|
|
47
|
+
// Namespace
|
|
48
|
+
parts.push(this.useColors ? ansis.cyan(`[${namespace}]`) : `[${namespace}]`);
|
|
49
|
+
// Message
|
|
50
|
+
parts.push(message);
|
|
51
|
+
// Context (if any non-standard fields)
|
|
52
|
+
const contextKeys = Object.keys(context).filter((k) => !['timestamp', 'level', 'namespace', 'runtime'].includes(k));
|
|
53
|
+
if (contextKeys.length > 0) {
|
|
54
|
+
const contextObj = {};
|
|
55
|
+
for (const key of contextKeys) {
|
|
56
|
+
contextObj[key] = context[key];
|
|
57
|
+
}
|
|
58
|
+
const contextStr = JSON.stringify(contextObj);
|
|
59
|
+
parts.push(this.useColors ? ansis.dim(contextStr) : contextStr);
|
|
60
|
+
}
|
|
61
|
+
return parts.join(' ');
|
|
62
|
+
}
|
|
63
|
+
parse(formatted) {
|
|
64
|
+
// Pretty format is not designed for parsing back
|
|
65
|
+
// Return a minimal entry with the raw line as message
|
|
66
|
+
return {
|
|
67
|
+
timestamp: new Date().toISOString(),
|
|
68
|
+
level: 'info',
|
|
69
|
+
namespace: 'unknown',
|
|
70
|
+
message: formatted,
|
|
71
|
+
context: {}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
formatBatch(entries) {
|
|
75
|
+
return entries.map((e) => this.format(e)).join('\n');
|
|
76
|
+
}
|
|
77
|
+
parseBatch(formatted) {
|
|
78
|
+
return formatted.split('\n').map((line) => this.parse(line));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=pretty.impl.cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty.impl.cli.js","sourceRoot":"","sources":["../../../src/formatters/pretty/pretty.impl.cli.ts"],"names":[],"mappings":"AAAA;;;;GAIG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D,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,SAAiB;QACtB,iDAAiD;QACjD,sDAAsD;QACtD,OAAO;YACN,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,EAAE;SACX,CAAC;IACH,CAAC;IAED,WAAW,CAAC,OAA0B;QACrC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,UAAU,CAAC,SAAiB;QAC3B,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;CACD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vibes Logging Module
|
|
3
|
+
*
|
|
4
|
+
* Runtime-aligned logging with sinks, formatters, outputs, and audit trails.
|
|
5
|
+
*
|
|
6
|
+
* ## Usage Pattern
|
|
7
|
+
*
|
|
8
|
+
* 1. Define a logger descriptor in your module:
|
|
9
|
+
* ```ts
|
|
10
|
+
* // myapp/logging/myapp.logger.descriptor.ts
|
|
11
|
+
* import type { LoggerDescriptor } from '@vibesdotdev/logging';
|
|
12
|
+
*
|
|
13
|
+
* const descriptor: LoggerDescriptor = {
|
|
14
|
+
* kind: 'logging/logger',
|
|
15
|
+
* id: 'myapp',
|
|
16
|
+
* namespace: 'myapp',
|
|
17
|
+
* runtime: 'server',
|
|
18
|
+
* sinks: ['console'],
|
|
19
|
+
* level: 'info'
|
|
20
|
+
* };
|
|
21
|
+
*
|
|
22
|
+
* export default descriptor;
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* 2. Get the logger from runtime:
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { getLogger } from '@vibesdotdev/logging';
|
|
28
|
+
*
|
|
29
|
+
* const logger = getLogger('myapp');
|
|
30
|
+
* logger.info('Application started', { version: '1.0.0' });
|
|
31
|
+
*
|
|
32
|
+
* // Child loggers
|
|
33
|
+
* const dbLogger = logger.child('database');
|
|
34
|
+
* dbLogger.debug('Connected to database');
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* 3. Audit logging:
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { auditLog } from '@vibesdotdev/logging';
|
|
40
|
+
*
|
|
41
|
+
* await auditLog({
|
|
42
|
+
* category: 'authentication',
|
|
43
|
+
* severity: 'medium',
|
|
44
|
+
* action: 'login',
|
|
45
|
+
* actor: { id: 'user-123', type: 'user' },
|
|
46
|
+
* outcome: 'success'
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @module
|
|
51
|
+
*/
|
|
52
|
+
export { default as loggingPlugin } from './logging.plugin';
|
|
53
|
+
export type { Logger, Runtime, RuntimeLoggerOptions, RuntimeLoggerConfig } from './core/types.ts';
|
|
54
|
+
export type { LoggerChildOptions } from './schemas/index.ts';
|
|
55
|
+
export declare const logger: import("./index.ts").LoggerImplementation;
|
|
56
|
+
export { parseNamespaceSettings, parseNamespaceSettingsFromEnv, shouldLog, updateNamespaceSettings, getNamespaceSettings, defaultNamespaceSettings, type NamespaceSettings, type NamespaceSelector, type NamespaceSelectors } from './core/namespace.ts';
|
|
57
|
+
export { LogLevelSchema, type LogLevel, LOG_LEVEL_ORDER, LogContextSchema, type LogContext, LoggerChildOptionsSchema, RuntimeLogEntrySchema, type RuntimeLogEntry, type RequestLogContext, type JobLogContext, type PerformanceTracker, type PerformanceTrackerParams, SinkDescriptorSchema, type SinkDescriptor, type SinkFormat, type SinkBatching, FormatterDescriptorSchema, type FormatterDescriptor, type FormatterOptions, OutputDescriptorSchema, type OutputDescriptor, type OutputRotation, type OutputBuffering, type OutputStorage, AuditDescriptorSchema, type AuditDescriptor, AuditEntrySchema, type AuditEntry, type AuditCategory, type AuditSeverity, type AuditOutcome, type AuditActor, type AuditTarget, LoggerDescriptorSchema, type LoggerDescriptor, type LoggerRuntime } from './schemas/index.ts';
|
|
58
|
+
export { sinkKind, type SinkImplementation, type SinkContext } from './kinds/sink.ts';
|
|
59
|
+
export { formatterKind, type FormatterImplementation, type FormatterContext } from './kinds/formatter.ts';
|
|
60
|
+
export { outputKind, type OutputImplementation, type OutputContext, type OutputReadOptions, type OutputTailOptions, type TailHandle, type OutputStats } from './kinds/output.ts';
|
|
61
|
+
export { auditKind, type AuditImplementation, type AuditContext, type AuditLogInput, type AuditQueryOptions } from './kinds/audit.ts';
|
|
62
|
+
export { loggerKind } from './kinds/logger.ts';
|
|
63
|
+
export { type LoggerImplementation, type LoggerContext } from './kinds/logger.impl';
|
|
64
|
+
export { configureLoggerContext, createLoggerContextProvider, getLoggerContext, setLoggerContext, getLogger, getDefaultLogger, registerLogger, initializeLoggers, type LoggerContextConfig, type LoggerContextProvider, type RuntimeLogger, type AuditContextConfig, type AuditContextProvider } from './contexts/index.ts';
|
|
65
|
+
export { type MemorySinkQueryOptions } from './sinks/index.ts';
|
|
66
|
+
export { AuditEntryStorageSchema, type AuditEntryStorage, type AuditRetentionPolicy, DEFAULT_RETENTION_POLICIES, type AuditStorageConfig, defaultAuditStorageConfig } from './audit/index.ts';
|
|
67
|
+
//# sourceMappingURL=index.d.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audit trails.
|
|
5
|
+
*
|
|
6
|
+
* ## Usage Pattern
|
|
7
|
+
*
|
|
8
|
+
* 1. Define a logger descriptor in your module:
|
|
9
|
+
* ```ts
|
|
10
|
+
* // myapp/logging/myapp.logger.descriptor.ts
|
|
11
|
+
* import type { LoggerDescriptor } from '@vibesdotdev/logging';
|
|
12
|
+
*
|
|
13
|
+
* const descriptor: LoggerDescriptor = {
|
|
14
|
+
* kind: 'logging/logger',
|
|
15
|
+
* id: 'myapp',
|
|
16
|
+
* namespace: 'myapp',
|
|
17
|
+
* runtime: 'server',
|
|
18
|
+
* sinks: ['console'],
|
|
19
|
+
* level: 'info'
|
|
20
|
+
* };
|
|
21
|
+
*
|
|
22
|
+
* export default descriptor;
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* 2. Get the logger from runtime:
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { getLogger } from '@vibesdotdev/logging';
|
|
28
|
+
*
|
|
29
|
+
* const logger = getLogger('myapp');
|
|
30
|
+
* logger.info('Application started', { version: '1.0.0' });
|
|
31
|
+
*
|
|
32
|
+
* // Child loggers
|
|
33
|
+
* const dbLogger = logger.child('database');
|
|
34
|
+
* dbLogger.debug('Connected to database');
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* 3. Audit logging:
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { auditLog } from '@vibesdotdev/logging';
|
|
40
|
+
*
|
|
41
|
+
* await auditLog({
|
|
42
|
+
* category: 'authentication',
|
|
43
|
+
* severity: 'medium',
|
|
44
|
+
* action: 'login',
|
|
45
|
+
* actor: { id: 'user-123', type: 'user' },
|
|
46
|
+
* outcome: 'success'
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @module
|
|
51
|
+
*/
|
|
52
|
+
// Plugin
|
|
53
|
+
export { default as loggingPlugin } from './logging.plugin.js';
|
|
54
|
+
/**
|
|
55
|
+
* Default logger instance.
|
|
56
|
+
* For most server-side code, use this directly.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { logger } from '@vibesdotdev/logging';
|
|
61
|
+
* logger.info('Server started');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
import { getDefaultLogger } from "./contexts/logger.js";
|
|
65
|
+
export const logger = getDefaultLogger();
|
|
66
|
+
// Namespace utilities
|
|
67
|
+
export { parseNamespaceSettings, parseNamespaceSettingsFromEnv, shouldLog, updateNamespaceSettings, getNamespaceSettings, defaultNamespaceSettings } from "./core/namespace.js";
|
|
68
|
+
// Schemas
|
|
69
|
+
export {
|
|
70
|
+
// Entry types
|
|
71
|
+
LogLevelSchema, LOG_LEVEL_ORDER, LogContextSchema, LoggerChildOptionsSchema, RuntimeLogEntrySchema,
|
|
72
|
+
// Sink schemas
|
|
73
|
+
SinkDescriptorSchema,
|
|
74
|
+
// Formatter schemas
|
|
75
|
+
FormatterDescriptorSchema,
|
|
76
|
+
// Output schemas
|
|
77
|
+
OutputDescriptorSchema,
|
|
78
|
+
// Audit schemas
|
|
79
|
+
AuditDescriptorSchema, AuditEntrySchema,
|
|
80
|
+
// Logger schemas
|
|
81
|
+
LoggerDescriptorSchema } from "./schemas/index.js";
|
|
82
|
+
// Kinds
|
|
83
|
+
export { sinkKind } from "./kinds/sink.js";
|
|
84
|
+
export { formatterKind } from "./kinds/formatter.js";
|
|
85
|
+
export { outputKind } from "./kinds/output.js";
|
|
86
|
+
export { auditKind } from "./kinds/audit.js";
|
|
87
|
+
export { loggerKind } from "./kinds/logger.js";
|
|
88
|
+
export {} from './kinds/logger.impl.js';
|
|
89
|
+
// Context providers
|
|
90
|
+
export {
|
|
91
|
+
// Logger context
|
|
92
|
+
configureLoggerContext, createLoggerContextProvider, getLoggerContext, setLoggerContext, getLogger, getDefaultLogger, registerLogger, initializeLoggers } from "./contexts/index.js";
|
|
93
|
+
// Sinks (types only — implementations autoloaded by runtime)
|
|
94
|
+
export {} from "./sinks/index.js";
|
|
95
|
+
// Audit (storage schemas only — implementations autoloaded by runtime)
|
|
96
|
+
export { AuditEntryStorageSchema, DEFAULT_RETENTION_POLICIES, defaultAuditStorageConfig } from "./audit/index.js";
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,SAAS;AACT,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQ5D;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;AAEzC,sBAAsB;AACtB,OAAO,EACN,sBAAsB,EACtB,6BAA6B,EAC7B,SAAS,EACT,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EAIxB,MAAM,qBAAqB,CAAC;AAE7B,UAAU;AACV,OAAO;AACN,cAAc;AACd,cAAc,EAEd,eAAe,EACf,gBAAgB,EAEhB,wBAAwB,EACxB,qBAAqB;AAMrB,eAAe;AACf,oBAAoB;AAIpB,oBAAoB;AACpB,yBAAyB;AAGzB,iBAAiB;AACjB,sBAAsB;AAKtB,gBAAgB;AAChB,qBAAqB,EAErB,gBAAgB;AAOhB,iBAAiB;AACjB,sBAAsB,EAGtB,MAAM,oBAAoB,CAAC;AAE5B,QAAQ;AACR,OAAO,EAAE,QAAQ,EAA6C,MAAM,iBAAiB,CAAC;AACtF,OAAO,EACN,aAAa,EAGb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,UAAU,EAOV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,SAAS,EAKT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAiD,MAAM,qBAAqB,CAAC;AAEpF,oBAAoB;AACpB,OAAO;AACN,iBAAiB;AACjB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EAOjB,MAAM,qBAAqB,CAAC;AAE7B,6DAA6D;AAC7D,OAAO,EAA+B,MAAM,kBAAkB,CAAC;AAE/D,uEAAuE;AACvE,OAAO,EACN,uBAAuB,EAGvB,0BAA0B,EAE1B,yBAAyB,EACzB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit Logging Kind Definition
|
|
3
|
+
*
|
|
4
|
+
* Audit loggers capture compliance and security events.
|
|
5
|
+
*/
|
|
6
|
+
import type { RuntimeKindDescriptor, KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
7
|
+
import { type AuditDescriptor, type AuditEntry, type AuditCategory, type AuditSeverity, type AuditOutcome, type AuditActor, type AuditTarget } from '../schemas/audit.ts';
|
|
8
|
+
/**
|
|
9
|
+
* Input for logging an audit event.
|
|
10
|
+
*/
|
|
11
|
+
export interface AuditLogInput {
|
|
12
|
+
/** Event category */
|
|
13
|
+
category: AuditCategory;
|
|
14
|
+
/** Severity level */
|
|
15
|
+
severity: AuditSeverity;
|
|
16
|
+
/** Action performed */
|
|
17
|
+
action: string;
|
|
18
|
+
/** Who triggered the event */
|
|
19
|
+
actor: AuditActor;
|
|
20
|
+
/** What was affected (optional) */
|
|
21
|
+
target?: AuditTarget;
|
|
22
|
+
/** Event outcome */
|
|
23
|
+
outcome: AuditOutcome;
|
|
24
|
+
/** Additional context */
|
|
25
|
+
context?: Record<string, unknown>;
|
|
26
|
+
/** Error details */
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Query options for retrieving audit entries.
|
|
31
|
+
*/
|
|
32
|
+
export interface AuditQueryOptions {
|
|
33
|
+
/** Filter by category */
|
|
34
|
+
category?: AuditCategory;
|
|
35
|
+
/** Filter by severity (minimum) */
|
|
36
|
+
severity?: AuditSeverity;
|
|
37
|
+
/** Filter by actor ID */
|
|
38
|
+
actorId?: string;
|
|
39
|
+
/** Filter by target ID */
|
|
40
|
+
targetId?: string;
|
|
41
|
+
/** Filter by action */
|
|
42
|
+
action?: string;
|
|
43
|
+
/** Filter by outcome */
|
|
44
|
+
outcome?: AuditOutcome;
|
|
45
|
+
/** Start time (ISO 8601) */
|
|
46
|
+
after?: string;
|
|
47
|
+
/** End time (ISO 8601) */
|
|
48
|
+
before?: string;
|
|
49
|
+
/** Maximum entries to return */
|
|
50
|
+
limit?: number;
|
|
51
|
+
/** Offset for pagination */
|
|
52
|
+
offset?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Audit implementation interface.
|
|
56
|
+
* Implementations persist audit entries with integrity guarantees.
|
|
57
|
+
*/
|
|
58
|
+
export interface AuditImplementation {
|
|
59
|
+
/** Log an audit event */
|
|
60
|
+
log(input: AuditLogInput): Promise<AuditEntry>;
|
|
61
|
+
/** Query audit entries (if supported) */
|
|
62
|
+
query?(options: AuditQueryOptions): Promise<AuditEntry[]>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Context provided to audit implementations.
|
|
66
|
+
*/
|
|
67
|
+
export interface AuditContext extends KindContext {
|
|
68
|
+
/** Runtime reference */
|
|
69
|
+
readonly runtime: unknown;
|
|
70
|
+
/** Workspace path for storage */
|
|
71
|
+
readonly workspacePath?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Audit kind definition for runtime registration.
|
|
75
|
+
*/
|
|
76
|
+
export declare const auditKind: RuntimeKindDescriptor<AuditDescriptor, AuditImplementation, AuditContext>;
|
|
77
|
+
declare module '@vibesdotdev/runtime/schemas/kind-types' {
|
|
78
|
+
interface KindTypeMap {
|
|
79
|
+
'logging/audit': {
|
|
80
|
+
descriptor: AuditDescriptor;
|
|
81
|
+
impl: AuditImplementation;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/kinds/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAqB,MAAM,mCAAmC,CAAC;AAE/G,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,qBAAqB;IACrB,QAAQ,EAAE,aAAa,CAAC;IACxB,qBAAqB;IACrB,QAAQ,EAAE,aAAa,CAAC;IACxB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,oBAAoB;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,yBAAyB;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,yBAAyB;IACzB,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,yCAAyC;IACzC,KAAK,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAChD,wBAAwB;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CAChC;AAkED;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,qBAAqB,CAAC,eAAe,EAAE,mBAAmB,EAAE,YAAY,CAO9F,CAAC;AAEH,OAAO,QAAQ,yCAAyC,CAAC;IACxD,UAAU,WAAW;QACpB,eAAe,EAAE;YAAE,UAAU,EAAE,eAAe,CAAC;YAAC,IAAI,EAAE,mBAAmB,CAAA;SAAE,CAAC;KAC5E;CACD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit Logging Kind Definition
|
|
3
|
+
*
|
|
4
|
+
* Audit loggers capture compliance and security events.
|
|
5
|
+
*/
|
|
6
|
+
import { AuditDescriptorSchema } from "../schemas/audit.js";
|
|
7
|
+
/**
|
|
8
|
+
* Default audit implementation - logs to stderr.
|
|
9
|
+
* Used when no specific implementation is registered.
|
|
10
|
+
*/
|
|
11
|
+
class DefaultAuditImplementation {
|
|
12
|
+
id;
|
|
13
|
+
descriptor;
|
|
14
|
+
constructor(descriptor, _context) {
|
|
15
|
+
this.id = descriptor.id;
|
|
16
|
+
this.descriptor = descriptor;
|
|
17
|
+
}
|
|
18
|
+
async log(input) {
|
|
19
|
+
const entry = {
|
|
20
|
+
id: crypto.randomUUID(),
|
|
21
|
+
timestamp: new Date().toISOString(),
|
|
22
|
+
category: input.category,
|
|
23
|
+
severity: input.severity,
|
|
24
|
+
action: input.action,
|
|
25
|
+
actor: input.actor,
|
|
26
|
+
target: input.target,
|
|
27
|
+
outcome: input.outcome,
|
|
28
|
+
context: input.context,
|
|
29
|
+
error: input.error
|
|
30
|
+
};
|
|
31
|
+
// Default: log to stderr to avoid stdout pollution (critical for MCP stdio)
|
|
32
|
+
console.error(`[AUDIT] ${JSON.stringify(entry)}`);
|
|
33
|
+
return entry;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Audit kind resolution logic.
|
|
38
|
+
* Selects audit logger based on category and hardware.
|
|
39
|
+
*/
|
|
40
|
+
function resolveAudit(candidates, scope, _context) {
|
|
41
|
+
const typed = candidates;
|
|
42
|
+
if (typed.length === 0)
|
|
43
|
+
return undefined;
|
|
44
|
+
if (typed.length === 1)
|
|
45
|
+
return typed[0];
|
|
46
|
+
const hardware = scope.hardware;
|
|
47
|
+
// Filter by hardware compatibility
|
|
48
|
+
const matching = typed.filter((d) => {
|
|
49
|
+
if (!d.hardware || d.hardware.length === 0)
|
|
50
|
+
return true;
|
|
51
|
+
return d.hardware.includes(hardware);
|
|
52
|
+
});
|
|
53
|
+
if (matching.length === 0)
|
|
54
|
+
return undefined;
|
|
55
|
+
// Prefer audits with explicit hardware match
|
|
56
|
+
const explicit = matching.filter((d) => d.hardware && d.hardware.length > 0);
|
|
57
|
+
if (explicit.length > 0)
|
|
58
|
+
return explicit[0];
|
|
59
|
+
return matching[0];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Audit kind definition for runtime registration.
|
|
63
|
+
*/
|
|
64
|
+
export const auditKind = {
|
|
65
|
+
id: 'logging/audit',
|
|
66
|
+
descriptorSchema: AuditDescriptorSchema,
|
|
67
|
+
defaultImplementation: DefaultAuditImplementation,
|
|
68
|
+
resolve: resolveAudit,
|
|
69
|
+
contexts: ['runtime/workspace-path']
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/kinds/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACN,qBAAqB,EAQrB,MAAM,qBAAqB,CAAC;AAuE7B;;;GAGG;AACH,MAAM,0BAA0B;IACtB,EAAE,CAAS;IACX,UAAU,CAAkB;IAErC,YAAY,UAA6B,EAAE,QAAsB;QAChE,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAA6B,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAoB;QAC7B,MAAM,KAAK,GAAe;YACzB,EAAE,EAAE,MAAM,CAAC,UAAU,EAAE;YACvB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;SAClB,CAAC;QAEF,4EAA4E;QAC5E,OAAO,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAElD,OAAO,KAAK,CAAC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1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging Context Types
|
|
3
|
+
*
|
|
4
|
+
* Shared context interfaces to avoid circular dependencies.
|
|
5
|
+
* This file contains only type definitions - no implementations.
|
|
6
|
+
*/
|
|
7
|
+
import type { KindContext } from '@vibesdotdev/runtime/schemas/kind';
|
|
8
|
+
import type { SinkImplementation } from './sink.ts';
|
|
9
|
+
import type { OutputImplementation } from './output.ts';
|
|
10
|
+
/**
|
|
11
|
+
* Context provided to logger implementations.
|
|
12
|
+
*/
|
|
13
|
+
export interface LoggerContext extends KindContext {
|
|
14
|
+
/** Runtime reference */
|
|
15
|
+
readonly runtime: unknown;
|
|
16
|
+
/** Available sinks for this logger */
|
|
17
|
+
readonly sinks?: Map<string, SinkImplementation> | SinkImplementation[];
|
|
18
|
+
/** Available outputs for this logger */
|
|
19
|
+
readonly outputs?: Map<string, OutputImplementation> | OutputImplementation[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/kinds/contexts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD,wBAAwB;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,kBAAkB,EAAE,CAAC;IACxE,wCAAwC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,oBAAoB,EAAE,CAAC;CAC9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../src/kinds/contexts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|