Enhance logging and error handling across the service#13
Conversation
…unctions for querying single and multiple values in sparql-utils.ts.
…actoring logger configuration management; standardized LogLevel
…ly; add logging configuration extractor for service context
- Updated logging configuration to include SPARQL context support and standardized log levels. - Refactored logger methods to improve performance by removing unnecessary async/await where applicable. - Introduced new utility functions for relativizing and expanding RDF quads, with corresponding unit tests. - Enhanced error handling with the `handleCaughtError` function, providing detailed logging for various error scenarios. - Removed outdated documentation on error handling and improved logging messages for service startup and configuration. - Updated dependencies in `deno.lock` to ensure compatibility with the latest Deno standard library.
WalkthroughThis update introduces significant refactoring and enhancement of the logging subsystem, including a switch to granular, channel-based logging configuration, unified log level handling, and new utilities for extracting and applying logging settings from ontology-based service configuration. It also adds new SPARQL utilities, improves RDF quad IRI handling, and updates logger initialization in the service startup. Several files are updated for type consistency, and new tests are added for quad utilities. Changes
Sequence Diagram(s)sequenceDiagram
participant ServiceMain as Service Main
participant Logger as Logger
participant ConfigExtractor as Logging Config Extractor
participant ServiceConfig as Service Config Accessor
ServiceMain->>Logger: Initialize logger (default config)
ServiceMain->>ServiceConfig: Load service config
ServiceMain->>ConfigExtractor: extractLoggingConfigFromService()
ConfigExtractor->>ServiceConfig: getConsoleLoggingConfig(), getFileLoggingConfig(), getSentryLoggingConfig()
ServiceConfig-->>ConfigExtractor: Channel configs
ConfigExtractor-->>ServiceMain: Structured LoggingConfig
ServiceMain->>Logger: Re-initialize logger (service config)
ServiceMain->>ServiceMain: Continue startup
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 10
🔭 Outside diff range comments (3)
flow-service/src/config/loaders/env-loader.ts (1)
258-260: Remove deprecatedFLOW_SENTRY_ENABLEDentry
FLOW_SENTRY_ENABLEDis no longer referenced in code; keeping it ingetEnvironmentVariables()is misleading.- "FLOW_SENTRY_ENABLED": Deno.env.get("FLOW_SENTRY_ENABLED"), "FLOW_SENTRY_DSN": Deno.env.get("FLOW_SENTRY_DSN"), "FLOW_SENTRY_LOGGING_ENABLED": Deno.env.get("FLOW_SENTRY_LOGGING_ENABLED"),flow-core/src/utils/logger/index.ts (2)
84-114: Remove duplicate serviceContext parameterThe
serviceContextis being passed twice tocreateLogger- once in the config object and again as a separate parameter. This appears to be redundant.export function createDefaultLogger( appName: string, appVersion?: string, ): StructuredLogger { return createLogger( { consoleChannel: { logChannelEnabled: true, logLevel: 'info', logFormat: 'pretty', }, fileChannel: { logChannelEnabled: true, logLevel: 'info', logFormat: 'json', logFilePath: './logs/app.log', }, sentryChannel: { logChannelEnabled: true, logLevel: 'error', }, serviceContext: { serviceName: appName, serviceVersion: appVersion || 'unknown', environment: Deno.env.get('DENO_ENV') || 'development', }, - }, - { - serviceContext: { - serviceName: appName, - serviceVersion: appVersion || 'unknown', - environment: Deno.env.get('DENO_ENV') || 'development', - }, }, ); }
127-157: Remove duplicate serviceContext parameter in createDefaultEnhancedLoggerSame issue as above - the
serviceContextis duplicated.export function createDefaultEnhancedLogger( appName: string, appVersion?: string, ): EnhancedStructuredLogger { return createEnhancedLogger( { consoleChannel: { logChannelEnabled: true, logLevel: 'info', logFormat: 'pretty', }, fileChannel: { logChannelEnabled: true, logLevel: 'info', logFormat: 'json', logFilePath: './logs/app.log', }, sentryChannel: { logChannelEnabled: true, logLevel: 'error', }, serviceContext: { serviceName: appName, serviceVersion: appVersion || 'unknown', environment: Deno.env.get('DENO_ENV') || 'development', }, - }, - { - serviceContext: { - serviceName: appName, - serviceVersion: appVersion || 'unknown', - environment: Deno.env.get('DENO_ENV') || 'development', - }, }, ); }
🧹 Nitpick comments (15)
flow-core/src/deps.ts (1)
2-2: Align quote style with ESLint ruleESLint quotes rule flagged this line (
Strings must use doublequote). Either change the rule or switch to double quotes consistently.-export { describe, it } from "https://deno.land/std@0.224.0/testing/bdd.ts"; +export { describe, it } from "https://deno.land/std@0.224.0/testing/bdd.ts";flow-service/src/utils/service-log-context.ts (2)
1-1: Fix ESLint quote violationStatic analysis reports
quoteserror on this line. Use double quotes (or update ESLint config).-import type { LogContext } from '../../../flow-core/src/utils/logger/logger-types.ts'; +import type { LogContext } from "../../../flow-core/src/utils/logger/logger-types.ts";
1-1: Consider switching to import-map alias instead of deep relative pathDeep relative traversal (
../../../flow-core/...) is brittle; a single rename breaks every consumer.
If you already ship an import-map (common in Deno projects), expose the logger types under an alias, e.g.:{ "imports": { "@flow-core/logger-types": "./flow-core/src/utils/logger/logger-types.ts" } }and then:
import type { LogContext } from "@flow-core/logger-types";This keeps service packages decoupled from core folder structure.
flow-core/src/utils/logger/error-handlers.ts (1)
7-7: Resolve ESLintquoteserrorSame quoting issue flagged by ESLint:
-import type { LogContext, ErrorHandlingOptions } from './logger-types.ts'; +import type { LogContext, ErrorHandlingOptions } from "./logger-types.ts";flow-core/tests/integration/logger/formatters.test.ts (1)
13-13: Match test import with project quote conventionESLint reports
quoteserror for this line as well.-import type { LogContext } from '../../../src/utils/logger/logger-types.ts'; +import type { LogContext } from "../../../src/utils/logger/logger-types.ts";flow-core/tests/integration/logger/error-handlers.test.ts (1)
13-13: Quote style violationApply the same quote-style fix here to satisfy ESLint.
-import type { LogContext } from '../../../src/utils/logger/logger-types.ts'; +import type { LogContext } from "../../../src/utils/logger/logger-types.ts";flow-service/src/service-constants.ts (1)
5-8: Fix ESLint quote rule violationThe new constant uses single quotes while the repo’s ESLint config expects double quotes.
-export const FLOW_SERVICE_INSTANCE_ID = Deno.env.get('FLOW_INSTANCE_ID') || crypto.randomUUID(); +export const FLOW_SERVICE_INSTANCE_ID = Deno.env.get("FLOW_INSTANCE_ID") || crypto.randomUUID();flow-service/tests/integration/logging/formatting-direct.test.ts (1)
91-113: Consider dropping the unnecessaryas LogLevelcastsSince the literals already satisfy the
LogLevelunion, the casts can be removed to reduce noise:- level: 'info' as LogLevel, + level: "info",(Apply similarly to the other cases.)
flow-core/src/utils/quadstore/quadstore-utils.ts (2)
44-44: Investigate the need for type castingThe
as anycast bypasses TypeScript's type safety. Consider investigating if this is due to incorrect type definitions in the quadstore library or if there's a more type-safe approach.If this cast is unavoidable due to library type issues, consider adding a comment explaining why it's necessary.
66-66: Investigate the need for type castingSimilar to line 44, the
as anycast bypasses type safety. Consider investigating the root cause of this type mismatch.flow-core/src/utils/sparql-utils.ts (1)
18-18: Improve type safety for bindings stream.The
as anytype assertions bypass type checking and could hide potential runtime errors. Consider defining proper types for the bindings stream or importing appropriate types from the SPARQL engine library.Consider investigating the proper return type from
bundle.engine.queryBindings()and using that instead ofany.Also applies to: 44-44
flow-service/src/config/loaders/quadstore-loader.ts (2)
21-21: Remove commented debug log statementsCommented-out debug log statements should be removed for cleaner code. If these are needed for debugging, consider using a debug log level instead.
- //logger.log(`Loading platform service defaults into graph:\n ${JSON.stringify(expandedPlatformServiceDefaults)}`); - //logger.log(inputConfig); - //logger.log(expandedInputServiceConfig)Also applies to: 50-50, 55-55
89-104: Use regular for...of loop instead of for await with synchronous arrayThe
expandedForMergedPlatformQuadsis a regular array returned byexpandRelativeQuads(), not an async iterable. Usingfor awaitis unnecessary and potentially confusing.- for await (const q of expandedForMergedPlatformQuads) { + for (const q of expandedForMergedPlatformQuads) {flow-service/src/config/resolution/service-config-accessor.ts (2)
1-1: Remove unnecessary empty line at file start.- import type { QuadstoreBundle } from '../../../../flow-core/src/types.ts';
68-114: Consider refactoring logging config methods to reduce duplication.The three logging config methods share identical structure. Consider extracting a common method:
private async getLoggingChannelConfig(channelProperty: string): Promise<{ enabled: boolean; level?: string }> { const sparql = ` PREFIX fsvc: <https://semantic-flow.github.io/ontology/flow-service/> SELECT ?enabled ?level WHERE { GRAPH <${getCurrentServiceUri(CONFIG_GRAPH_NAMES.mergedServiceConfig)}> { ?s ${channelProperty} ?channel . ?channel fsvc:logChannelEnabled ?enabled . OPTIONAL { ?channel fsvc:logLevel ?level . } } } `; const enabledStr = await this.getConfigValueFromSparql(sparql, 'enabled'); const level = await this.getConfigValueFromSparql(sparql, 'level'); return { enabled: enabledStr === 'true', level: level ?? undefined }; } async getConsoleLoggingConfig(): Promise<{ enabled: boolean; level?: string }> { return this.getLoggingChannelConfig('fsvc:hasConsoleChannel'); } async getFileLoggingConfig(): Promise<{ enabled: boolean; level?: string }> { return this.getLoggingChannelConfig('fsvc:hasFileChannel'); } async getSentryLoggingConfig(): Promise<{ enabled: boolean; level?: string }> { return this.getLoggingChannelConfig('fsvc:hasSentryChannel'); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
deno.lockis excluded by!**/*.lockflow-service/deno.lockis excluded by!**/*.lockpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (32)
flow-core/src/deps.ts(2 hunks)flow-core/src/platform-constants.ts(1 hunks)flow-core/src/utils/logger/component-logger.ts(1 hunks)flow-core/src/utils/logger/error-handlers.ts(1 hunks)flow-core/src/utils/logger/formatters.ts(5 hunks)flow-core/src/utils/logger/index.ts(4 hunks)flow-core/src/utils/logger/logger-types.ts(3 hunks)flow-core/src/utils/logger/sentry-logger.ts(3 hunks)flow-core/src/utils/logger/structured-logger.ts(14 hunks)flow-core/src/utils/quadstore/quadstore-utils.ts(2 hunks)flow-core/src/utils/rdfjs-utils.ts(1 hunks)flow-core/src/utils/sparql-utils.ts(1 hunks)flow-core/tests/integration/logger/error-handlers.test.ts(1 hunks)flow-core/tests/integration/logger/formatters.test.ts(1 hunks)flow-core/tests/unit/rdfjs-utils.test.ts(1 hunks)flow-service/documentation/error-handling-usage.md(0 hunks)flow-service/flow-service-config.jsonld(1 hunks)flow-service/main.ts(3 hunks)flow-service/src/config/config-types.ts(4 hunks)flow-service/src/config/defaults.ts(3 hunks)flow-service/src/config/index.ts(0 hunks)flow-service/src/config/loaders/env-loader.ts(1 hunks)flow-service/src/config/loaders/quadstore-loader.ts(3 hunks)flow-service/src/config/logging-config-extractor.ts(1 hunks)flow-service/src/config/resolution/service-config-accessor.ts(1 hunks)flow-service/src/config/resolution/service-config-resolver.ts(5 hunks)flow-service/src/service-constants.ts(1 hunks)flow-service/src/utils/service-log-context.ts(1 hunks)flow-service/src/utils/service-logger.ts(4 hunks)flow-service/src/utils/startup-logger.ts(2 hunks)flow-service/tests/integration/logging/formatting-direct.test.ts(2 hunks)package.json(0 hunks)
💤 Files with no reviewable changes (3)
- package.json
- flow-service/src/config/index.ts
- flow-service/documentation/error-handling-usage.md
🧰 Additional context used
🧬 Code Graph Analysis (4)
flow-service/tests/integration/logging/formatting-direct.test.ts (2)
flow-core/src/utils/logger/logger-types.ts (1)
LogLevel(156-156)flow-core/src/utils/logger/types.ts (2)
LogLevel(151-158)LogContext(11-78)
flow-core/src/utils/logger/sentry-logger.ts (1)
flow-core/src/utils/logger/types.ts (1)
LogContext(11-78)
flow-core/src/utils/logger/formatters.ts (3)
flow-core/src/utils/logger/index.ts (2)
LogLevel(22-22)colorize(27-27)flow-core/src/utils/logger/logger-types.ts (1)
LogLevel(156-156)flow-core/src/utils/logger/types.ts (2)
LogContext(11-78)LogLevel(151-158)
flow-service/src/config/config-types.ts (2)
flow-core/src/utils/logger/logger-types.ts (1)
LogLevel(156-156)flow-core/src/utils/logger/types.ts (2)
LoggerConfig(163-199)LogLevel(151-158)
🪛 ESLint
flow-core/src/utils/logger/error-handlers.ts
[error] 7-7: Strings must use doublequote.
(quotes)
flow-core/tests/integration/logger/error-handlers.test.ts
[error] 13-13: Strings must use doublequote.
(quotes)
flow-service/src/utils/service-log-context.ts
[error] 1-1: Strings must use doublequote.
(quotes)
flow-service/src/service-constants.ts
[error] 8-8: Strings must use doublequote.
(quotes)
flow-service/tests/integration/logging/formatting-direct.test.ts
[error] 12-12: Strings must use doublequote.
(quotes)
[error] 91-91: Unquoted property 'level' found.
(quote-props)
[error] 91-91: Strings must use doublequote.
(quotes)
[error] 92-92: Unquoted property 'message' found.
(quote-props)
[error] 92-92: Strings must use doublequote.
(quotes)
[error] 93-96: Unquoted property 'context' found.
(quote-props)
[error] 94-94: Unquoted property 'operation' found.
(quote-props)
[error] 94-94: Strings must use doublequote.
(quotes)
[error] 95-95: Unquoted property 'component' found.
(quote-props)
[error] 95-95: Strings must use doublequote.
(quotes)
[error] 99-99: Unquoted property 'level' found.
(quote-props)
[error] 99-99: Strings must use doublequote.
(quotes)
[error] 100-100: Unquoted property 'message' found.
(quote-props)
[error] 100-100: Strings must use doublequote.
(quotes)
[error] 101-104: Unquoted property 'context' found.
(quote-props)
[error] 102-102: Unquoted property 'operation' found.
(quote-props)
[error] 102-102: Strings must use doublequote.
(quotes)
[error] 103-103: Unquoted property 'configSource' found.
(quote-props)
[error] 103-103: Strings must use doublequote.
(quotes)
[error] 107-107: Unquoted property 'level' found.
(quote-props)
[error] 107-107: Strings must use doublequote.
(quotes)
[error] 108-108: Unquoted property 'message' found.
(quote-props)
[error] 108-108: Strings must use doublequote.
(quotes)
[error] 109-109: Unquoted property 'context' found.
(quote-props)
[error] 109-109: Unquoted property 'operation' found.
(quote-props)
[error] 109-109: Strings must use doublequote.
(quotes)
[error] 109-109: Unquoted property 'duration' found.
(quote-props)
[error] 112-112: Unquoted property 'level' found.
(quote-props)
[error] 112-112: Strings must use doublequote.
(quotes)
flow-core/src/platform-constants.ts
[error] 1-1: Strings must use doublequote.
(quotes)
flow-core/tests/integration/logger/formatters.test.ts
[error] 13-13: Strings must use doublequote.
(quotes)
flow-service/src/config/resolution/service-config-resolver.ts
[error] 11-11: Strings must use doublequote.
(quotes)
[error] 12-12: Strings must use doublequote.
(quotes)
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 14-14: Strings must use doublequote.
(quotes)
[error] 89-89: Strings must use doublequote.
(quotes)
flow-core/tests/unit/rdfjs-utils.test.ts
[error] 1-1: Strings must use doublequote.
(quotes)
[error] 2-2: Strings must use doublequote.
(quotes)
[error] 3-3: Strings must use doublequote.
(quotes)
[error] 4-4: Strings must use doublequote.
(quotes)
[error] 8-8: Strings must use doublequote.
(quotes)
[error] 9-9: Strings must use doublequote.
(quotes)
[error] 11-11: Strings must use doublequote.
(quotes)
[error] 14-14: Strings must use doublequote.
(quotes)
[error] 15-15: Strings must use doublequote.
(quotes)
[error] 16-16: Strings must use doublequote.
(quotes)
[error] 17-17: Strings must use doublequote.
(quotes)
[error] 21-21: Strings must use doublequote.
(quotes)
[error] 22-22: Strings must use doublequote.
(quotes)
[error] 23-23: Strings must use doublequote.
(quotes)
[error] 24-24: Strings must use doublequote.
(quotes)
[error] 27-27: Strings must use doublequote.
(quotes)
[error] 30-30: Strings must use doublequote.
(quotes)
[error] 31-31: Strings must use doublequote.
(quotes)
[error] 32-32: Strings must use doublequote.
(quotes)
[error] 32-32: Strings must use doublequote.
(quotes)
[error] 37-37: Strings must use doublequote.
(quotes)
[error] 38-38: Strings must use doublequote.
(quotes)
[error] 42-42: Strings must use doublequote.
(quotes)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 48-48: Strings must use doublequote.
(quotes)
[error] 49-49: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 55-55: Strings must use doublequote.
(quotes)
[error] 56-56: Strings must use doublequote.
(quotes)
[error] 57-57: Strings must use doublequote.
(quotes)
[error] 58-58: Strings must use doublequote.
(quotes)
[error] 61-61: Strings must use doublequote.
(quotes)
[error] 64-64: Strings must use doublequote.
(quotes)
[error] 65-65: Strings must use doublequote.
(quotes)
[error] 66-66: Strings must use doublequote.
(quotes)
[error] 66-66: Strings must use doublequote.
(quotes)
[error] 71-71: Strings must use doublequote.
(quotes)
[error] 72-72: Strings must use doublequote.
(quotes)
flow-service/main.ts
[error] 31-31: Unquoted property 'operation' found.
(quote-props)
[error] 54-54: Unquoted property 'operation' found.
(quote-props)
[error] 68-68: Unquoted property 'operation' found.
(quote-props)
[error] 85-85: Unquoted property 'openapi' found.
(quote-props)
[error] 86-90: Unquoted property 'info' found.
(quote-props)
[error] 87-87: Unquoted property 'version' found.
(quote-props)
[error] 88-88: Unquoted property 'title' found.
(quote-props)
[error] 89-89: Unquoted property 'description' found.
(quote-props)
[error] 91-97: Unquoted property 'servers' found.
(quote-props)
[error] 93-94: Unquoted property 'url' found.
(quote-props)
[error] 95-95: Unquoted property 'description' found.
(quote-props)
[error] 106-106: Unquoted property 'spec' found.
(quote-props)
[error] 106-106: Unquoted property 'url' found.
(quote-props)
[error] 107-107: Unquoted property 'pageTitle' found.
(quote-props)
[error] 108-108: Unquoted property 'theme' found.
(quote-props)
[error] 109-109: Unquoted property 'layout' found.
(quote-props)
[error] 118-118: Unquoted property 'operation' found.
(quote-props)
[error] 148-148: Unquoted property 'operation' found.
(quote-props)
[error] 160-160: Unquoted property 'operation' found.
(quote-props)
[error] 161-164: Unquoted property 'metadata' found.
(quote-props)
[error] 162-163: Unquoted property 'serverEndpoint' found.
(quote-props)
flow-core/src/utils/logger/sentry-logger.ts
[error] 7-7: Strings must use doublequote.
(quotes)
[error] 53-53: Unquoted property 'release' found.
(quote-props)
[error] 53-53: Strings must use doublequote.
(quotes)
[error] 286-286: Strings must use doublequote.
(quotes)
[error] 287-287: Strings must use doublequote.
(quotes)
[error] 288-288: Strings must use doublequote.
(quotes)
[error] 289-289: Strings must use doublequote.
(quotes)
[error] 290-290: Strings must use doublequote.
(quotes)
[error] 291-291: Strings must use doublequote.
(quotes)
[error] 292-292: Strings must use doublequote.
(quotes)
[error] 293-293: Strings must use doublequote.
(quotes)
[error] 294-294: Strings must use doublequote.
(quotes)
flow-service/src/config/logging-config-extractor.ts
[error] 6-6: Strings must use doublequote.
(quotes)
[error] 7-7: Strings must use doublequote.
(quotes)
[error] 8-8: Strings must use doublequote.
(quotes)
[error] 9-9: Strings must use doublequote.
(quotes)
[error] 10-10: Strings must use doublequote.
(quotes)
[error] 11-11: Strings must use doublequote.
(quotes)
[error] 12-12: Strings must use doublequote.
(quotes)
[error] 23-23: Unquoted property 'serviceName' found.
(quote-props)
[error] 24-24: Unquoted property 'serviceVersion' found.
(quote-props)
[error] 24-24: Strings must use doublequote.
(quotes)
[error] 25-25: Unquoted property 'environment' found.
(quote-props)
[error] 25-25: Strings must use doublequote.
(quotes)
[error] 25-25: Strings must use doublequote.
(quotes)
[error] 26-26: Unquoted property 'instanceId' found.
(quote-props)
[error] 39-39: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 40-40: Unquoted property 'fileChannel' found.
(quote-props)
[error] 41-41: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 54-54: Strings must use doublequote.
(quotes)
[error] 54-54: Strings must use doublequote.
(quotes)
[error] 54-54: Strings must use doublequote.
(quotes)
[error] 54-54: Strings must use doublequote.
(quotes)
[error] 57-57: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 58-58: Unquoted property 'logLevel' found.
(quote-props)
[error] 58-58: Strings must use doublequote.
(quotes)
[error] 59-59: Unquoted property 'logFormat' found.
(quote-props)
[error] 59-59: Strings must use doublequote.
(quotes)
[error] 63-63: Strings must use doublequote.
(quotes)
[error] 65-65: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 66-66: Unquoted property 'logLevel' found.
(quote-props)
[error] 66-66: Strings must use doublequote.
(quotes)
[error] 67-67: Unquoted property 'logFormat' found.
(quote-props)
[error] 67-67: Strings must use doublequote.
(quotes)
[error] 80-80: Strings must use doublequote.
(quotes)
[error] 80-80: Strings must use doublequote.
(quotes)
[error] 80-80: Strings must use doublequote.
(quotes)
[error] 80-80: Strings must use doublequote.
(quotes)
[error] 81-81: Strings must use doublequote.
(quotes)
[error] 81-81: Strings must use doublequote.
(quotes)
[error] 82-82: Strings must use doublequote.
(quotes)
[error] 82-82: Strings must use doublequote.
(quotes)
[error] 83-83: Strings must use doublequote.
(quotes)
[error] 83-83: Strings must use doublequote.
(quotes)
[error] 84-84: Strings must use doublequote.
(quotes)
[error] 84-84: Strings must use doublequote.
(quotes)
[error] 85-85: Strings must use doublequote.
(quotes)
[error] 85-85: Strings must use doublequote.
(quotes)
[error] 85-85: Strings must use doublequote.
(quotes)
[error] 85-85: Strings must use doublequote.
(quotes)
[error] 85-85: Strings must use doublequote.
(quotes)
[error] 85-85: Strings must use doublequote.
(quotes)
[error] 88-88: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 89-89: Unquoted property 'logLevel' found.
(quote-props)
[error] 89-89: Strings must use doublequote.
(quotes)
[error] 90-90: Unquoted property 'logFormat' found.
(quote-props)
[error] 90-90: Strings must use doublequote.
(quotes)
[error] 91-91: Unquoted property 'logFilePath' found.
(quote-props)
[error] 91-91: Strings must use doublequote.
(quotes)
[error] 92-92: Unquoted property 'logRetentionDays' found.
(quote-props)
[error] 93-93: Unquoted property 'logMaxFiles' found.
(quote-props)
[error] 94-94: Unquoted property 'logMaxFileSize' found.
(quote-props)
[error] 95-95: Unquoted property 'logRotationInterval' found.
(quote-props)
[error] 95-95: Strings must use doublequote.
(quotes)
[error] 99-99: Strings must use doublequote.
(quotes)
[error] 101-101: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 102-102: Unquoted property 'logLevel' found.
(quote-props)
[error] 102-102: Strings must use doublequote.
(quotes)
[error] 103-103: Unquoted property 'logFormat' found.
(quote-props)
[error] 103-103: Strings must use doublequote.
(quotes)
[error] 104-104: Unquoted property 'logFilePath' found.
(quote-props)
[error] 104-104: Strings must use doublequote.
(quotes)
[error] 105-105: Unquoted property 'logRetentionDays' found.
(quote-props)
[error] 106-106: Unquoted property 'logMaxFiles' found.
(quote-props)
[error] 107-107: Unquoted property 'logMaxFileSize' found.
(quote-props)
[error] 108-108: Unquoted property 'logRotationInterval' found.
(quote-props)
[error] 108-108: Strings must use doublequote.
(quotes)
[error] 121-121: Strings must use doublequote.
(quotes)
[error] 121-121: Strings must use doublequote.
(quotes)
[error] 124-124: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 125-125: Unquoted property 'logLevel' found.
(quote-props)
[error] 125-125: Strings must use doublequote.
(quotes)
[error] 126-126: Unquoted property 'sentryDsn' found.
(quote-props)
[error] 126-126: Strings must use doublequote.
(quotes)
[error] 130-130: Strings must use doublequote.
(quotes)
[error] 132-132: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 133-133: Unquoted property 'logLevel' found.
(quote-props)
[error] 133-133: Strings must use doublequote.
(quotes)
[error] 134-134: Unquoted property 'sentryDsn' found.
(quote-props)
[error] 134-134: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/formatters.ts
[error] 6-6: Strings must use doublequote.
(quotes)
[error] 25-25: Unquoted property 'debug' found.
(quote-props)
[error] 26-26: Unquoted property 'info' found.
(quote-props)
[error] 27-27: Unquoted property 'warn' found.
(quote-props)
[error] 28-28: Unquoted property 'error' found.
(quote-props)
[error] 29-29: Unquoted property 'critical' found.
(quote-props)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 91-91: Unquoted property 'version' found.
(quote-props)
[error] 91-91: Strings must use doublequote.
(quotes)
[error] 117-117: Strings must use doublequote.
(quotes)
[error] 117-117: Strings must use doublequote.
(quotes)
[error] 118-118: Strings must use doublequote.
(quotes)
[error] 119-119: Strings must use doublequote.
(quotes)
[error] 120-120: Strings must use doublequote.
(quotes)
[error] 121-121: Strings must use doublequote.
(quotes)
[error] 122-122: Strings must use doublequote.
(quotes)
[error] 123-123: Strings must use doublequote.
(quotes)
flow-core/src/utils/rdfjs-utils.ts
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 52-52: Strings must use doublequote.
(quotes)
[error] 53-53: Strings must use doublequote.
(quotes)
[error] 71-71: Strings must use doublequote.
(quotes)
[error] 72-72: Strings must use doublequote.
(quotes)
[error] 74-74: Strings must use doublequote.
(quotes)
[error] 76-76: Strings must use doublequote.
(quotes)
[error] 81-81: Strings must use doublequote.
(quotes)
[error] 81-81: Strings must use doublequote.
(quotes)
[error] 83-83: Strings must use doublequote.
(quotes)
[error] 84-84: Strings must use doublequote.
(quotes)
flow-service/src/utils/startup-logger.ts
[error] 21-21: Strings must use doublequote.
(quotes)
[error] 28-28: Strings must use doublequote.
(quotes)
[error] 35-35: Strings must use doublequote.
(quotes)
[error] 42-42: Strings must use doublequote.
(quotes)
[error] 42-42: Strings must use doublequote.
(quotes)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 49-49: Strings must use doublequote.
(quotes)
[error] 49-49: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 56-56: Strings must use doublequote.
(quotes)
[error] 56-56: Strings must use doublequote.
(quotes)
[error] 58-58: Strings must use doublequote.
(quotes)
[error] 79-79: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/index.ts
[error] 20-20: Strings must use doublequote.
(quotes)
[error] 22-22: Strings must use doublequote.
(quotes)
[error] 23-23: Strings must use doublequote.
(quotes)
[error] 70-70: Strings must use doublequote.
(quotes)
[error] 86-90: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 87-87: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 88-88: Unquoted property 'logLevel' found.
(quote-props)
[error] 88-88: Strings must use doublequote.
(quotes)
[error] 89-89: Unquoted property 'logFormat' found.
(quote-props)
[error] 89-89: Strings must use doublequote.
(quotes)
[error] 91-96: Unquoted property 'fileChannel' found.
(quote-props)
[error] 92-92: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 93-93: Unquoted property 'logLevel' found.
(quote-props)
[error] 93-93: Strings must use doublequote.
(quotes)
[error] 94-94: Unquoted property 'logFormat' found.
(quote-props)
[error] 94-94: Strings must use doublequote.
(quotes)
[error] 95-95: Unquoted property 'logFilePath' found.
(quote-props)
[error] 95-95: Strings must use doublequote.
(quotes)
[error] 97-100: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 98-98: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 99-99: Unquoted property 'logLevel' found.
(quote-props)
[error] 99-99: Strings must use doublequote.
(quotes)
[error] 129-133: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 130-130: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 131-131: Unquoted property 'logLevel' found.
(quote-props)
[error] 131-131: Strings must use doublequote.
(quotes)
[error] 132-132: Unquoted property 'logFormat' found.
(quote-props)
[error] 132-132: Strings must use doublequote.
(quotes)
[error] 134-139: Unquoted property 'fileChannel' found.
(quote-props)
[error] 135-135: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 136-136: Unquoted property 'logLevel' found.
(quote-props)
[error] 136-136: Strings must use doublequote.
(quotes)
[error] 137-137: Unquoted property 'logFormat' found.
(quote-props)
[error] 137-137: Strings must use doublequote.
(quotes)
[error] 138-138: Unquoted property 'logFilePath' found.
(quote-props)
[error] 138-138: Strings must use doublequote.
(quotes)
[error] 140-143: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 141-141: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 142-142: Unquoted property 'logLevel' found.
(quote-props)
[error] 142-142: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/component-logger.ts
[error] 33-33: Unquoted property 'enableConsole' found.
(quote-props)
[error] 34-34: Unquoted property 'enableFile' found.
(quote-props)
[error] 35-35: Unquoted property 'enableSentry' found.
(quote-props)
flow-core/src/utils/sparql-utils.ts
[error] 2-2: Strings must use doublequote.
(quotes)
[error] 3-3: Strings must use doublequote.
(quotes)
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 17-17: Unquoted property 'sources' found.
(quote-props)
[error] 19-19: Strings must use doublequote.
(quotes)
[error] 39-39: Strings must use doublequote.
(quotes)
[error] 43-43: Unquoted property 'sources' found.
(quote-props)
[error] 45-45: Strings must use doublequote.
(quotes)
flow-service/src/utils/service-logger.ts
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 25-25: Unquoted property 'serviceVersion' found.
(quote-props)
[error] 25-25: Strings must use doublequote.
(quotes)
[error] 26-26: Unquoted property 'environment' found.
(quote-props)
[error] 26-26: Strings must use doublequote.
(quotes)
[error] 26-26: Strings must use doublequote.
(quotes)
[error] 27-27: Unquoted property 'instanceId' found.
(quote-props)
[error] 27-27: Strings must use doublequote.
(quotes)
[error] 34-38: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 35-35: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 36-36: Unquoted property 'logLevel' found.
(quote-props)
[error] 36-36: Strings must use doublequote.
(quotes)
[error] 37-37: Unquoted property 'logFormat' found.
(quote-props)
[error] 37-37: Strings must use doublequote.
(quotes)
[error] 40-48: Unquoted property 'fileChannel' found.
(quote-props)
[error] 41-41: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 42-42: Unquoted property 'logLevel' found.
(quote-props)
[error] 42-42: Strings must use doublequote.
(quotes)
[error] 43-43: Unquoted property 'logFormat' found.
(quote-props)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 44-44: Unquoted property 'logFilePath' found.
(quote-props)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 45-45: Unquoted property 'logMaxFileSize' found.
(quote-props)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 46-46: Unquoted property 'logMaxFiles' found.
(quote-props)
[error] 46-46: Strings must use doublequote.
(quotes)
[error] 46-46: Strings must use doublequote.
(quotes)
[error] 47-47: Unquoted property 'logRotationInterval' found.
(quote-props)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 51-51: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 52-52: Unquoted property 'logLevel' found.
(quote-props)
[error] 52-52: Strings must use doublequote.
(quotes)
[error] 53-53: Unquoted property 'sentryDsn' found.
(quote-props)
[error] 53-53: Strings must use doublequote.
(quotes)
flow-service/src/config/loaders/quadstore-loader.ts
[error] 43-43: Unquoted property 'graphName' found.
(quote-props)
[error] 56-56: Unquoted property 'graphName' found.
(quote-props)
[error] 59-59: Unquoted property 'graphName' found.
(quote-props)
[error] 85-85: Unquoted property 'subject' found.
(quote-props)
[error] 85-85: Unquoted property 'predicate' found.
(quote-props)
[error] 85-85: Unquoted property 'object' found.
(quote-props)
[error] 85-85: Unquoted property 'graph' found.
(quote-props)
[error] 91-91: Unquoted property 'subject' found.
(quote-props)
[error] 91-91: Unquoted property 'predicate' found.
(quote-props)
[error] 91-91: Unquoted property 'object' found.
(quote-props)
[error] 91-91: Unquoted property 'graph' found.
(quote-props)
[error] 93-93: Strings must use doublequote.
(quotes)
[error] 93-93: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/logger-types.ts
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 167-167: Unquoted property 'debug' found.
(quote-props)
[error] 168-168: Unquoted property 'info' found.
(quote-props)
[error] 169-169: Unquoted property 'warn' found.
(quote-props)
[error] 170-170: Unquoted property 'error' found.
(quote-props)
[error] 171-171: Unquoted property 'critical' found.
(quote-props)
[error] 185-185: Strings must use doublequote.
(quotes)
[error] 185-185: Strings must use doublequote.
(quotes)
[error] 212-212: Strings must use doublequote.
(quotes)
[error] 212-212: Strings must use doublequote.
(quotes)
[error] 212-212: Strings must use doublequote.
(quotes)
[error] 212-212: Strings must use doublequote.
(quotes)
flow-service/src/config/resolution/service-config-accessor.ts
[error] 2-2: Strings must use doublequote.
(quotes)
[error] 3-3: Strings must use doublequote.
(quotes)
[error] 4-4: Strings must use doublequote.
(quotes)
[error] 5-5: Strings must use doublequote.
(quotes)
[error] 6-6: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 55-55: Strings must use doublequote.
(quotes)
[error] 59-59: Strings must use doublequote.
(quotes)
[error] 63-63: Strings must use doublequote.
(quotes)
[error] 79-79: Strings must use doublequote.
(quotes)
[error] 80-80: Strings must use doublequote.
(quotes)
[error] 81-81: Unquoted property 'enabled' found.
(quote-props)
[error] 81-81: Strings must use doublequote.
(quotes)
[error] 81-81: Unquoted property 'level' found.
(quote-props)
[error] 95-95: Strings must use doublequote.
(quotes)
[error] 96-96: Strings must use doublequote.
(quotes)
[error] 97-97: Unquoted property 'enabled' found.
(quote-props)
[error] 97-97: Strings must use doublequote.
(quotes)
[error] 97-97: Unquoted property 'level' found.
(quote-props)
[error] 111-111: Strings must use doublequote.
(quotes)
[error] 112-112: Strings must use doublequote.
(quotes)
[error] 113-113: Unquoted property 'enabled' found.
(quote-props)
[error] 113-113: Strings must use doublequote.
(quotes)
[error] 113-113: Unquoted property 'level' found.
(quote-props)
[error] 118-118: Strings must use doublequote.
(quotes)
[error] 121-121: Unquoted property 'sources' found.
(quote-props)
flow-core/src/utils/logger/structured-logger.ts
[error] 6-6: Strings must use doublequote.
(quotes)
[error] 12-12: Strings must use doublequote.
(quotes)
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 35-39: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 36-36: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 37-37: Unquoted property 'logLevel' found.
(quote-props)
[error] 37-37: Strings must use doublequote.
(quotes)
[error] 38-38: Unquoted property 'logFormat' found.
(quote-props)
[error] 38-38: Strings must use doublequote.
(quotes)
[error] 40-44: Unquoted property 'fileChannel' found.
(quote-props)
[error] 41-41: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 42-42: Unquoted property 'logLevel' found.
(quote-props)
[error] 42-42: Strings must use doublequote.
(quotes)
[error] 43-43: Unquoted property 'logFormat' found.
(quote-props)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 45-48: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 46-46: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 47-47: Unquoted property 'logLevel' found.
(quote-props)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 61-61: Strings must use doublequote.
(quotes)
[error] 63-63: Strings must use doublequote.
(quotes)
[error] 74-74: Strings must use doublequote.
(quotes)
[error] 76-76: Strings must use doublequote.
(quotes)
[error] 87-87: Strings must use doublequote.
(quotes)
[error] 89-89: Strings must use doublequote.
(quotes)
[error] 100-100: Strings must use doublequote.
(quotes)
[error] 102-102: Strings must use doublequote.
(quotes)
[error] 114-114: Strings must use doublequote.
(quotes)
[error] 185-185: Unquoted property 'debug' found.
(quote-props)
[error] 185-185: Unquoted property 'info' found.
(quote-props)
[error] 185-185: Unquoted property 'warn' found.
(quote-props)
[error] 185-185: Unquoted property 'error' found.
(quote-props)
[error] 185-185: Unquoted property 'critical' found.
(quote-props)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 202-202: Strings must use doublequote.
(quotes)
[error] 205-205: Strings must use doublequote.
(quotes)
[error] 208-208: Strings must use doublequote.
(quotes)
[error] 209-209: Strings must use doublequote.
(quotes)
[error] 257-257: Strings must use doublequote.
(quotes)
[error] 257-257: Strings must use doublequote.
(quotes)
[error] 313-313: Strings must use doublequote.
(quotes)
[error] 326-326: Strings must use doublequote.
(quotes)
[error] 348-348: Strings must use doublequote.
(quotes)
🔇 Additional comments (41)
flow-service/flow-service-config.jsonld (1)
11-13: Validate additional mesh path & guard against duplicationThe new
"../meshes/ns/"entry looks fine, but please double-check at runtime that:
- The resolved absolute path is distinct from
"../meshes/test-ns/"(case-sensitivity, symlinks, etc.).- No duplicated meshes are accidentally loaded, which could bloat startup time and logging noise.
If duplicates are harmless, consider documenting that fact in the README.
flow-service/src/config/defaults.ts (1)
107-112: Lower-case log levels: all good
"error"/"warn"are now lowercase and align with the newLogLevelunion type inflow-core. No further action required.Also applies to: 146-150, 175-179
flow-service/tests/integration/logging/formatting-direct.test.ts (1)
12-13: Importing sharedLogLeveltype — LGTM
The test now relies on the single source-of-truth type, preventing drift.flow-service/src/config/loaders/env-loader.ts (1)
164-172: Sentry env var rename looks good but leave a migration noteThe loader now honors
FLOW_SENTRY_LOGGING_ENABLED. Ensure deployment manifests are updated accordingly so Sentry doesn’t get silently disabled.flow-core/src/utils/logger/sentry-logger.ts (3)
7-7: LGTM: Import consolidation improves code organizationConsolidating
LogContextandLogLevelimports from the centralizedlogger-types.tsmodule aligns well with the logging system refactoring and reduces import complexity.
53-53: LGTM: Environment variable standardizationThe change from
FLOW_VERSIONtoFLOW_SERVICE_VERSIONstandardizes service versioning across the logging system and aligns with similar updates in other modules.
284-298: LGTM: Log level mapping updated for consistencyThe switch to lowercase string literals in the
mapLogLevelToSentryfunction correctly aligns with the newLogLeveltype definition. The mapping logic to Sentry severity levels remains accurate.flow-core/src/platform-constants.ts (1)
1-1: LGTM: Centralized logging types improve consistencyMoving to import
LogLevelandvalidLogLevelsfrom the centralizedlogger-types.tsmodule eliminates code duplication and ensures consistent log level definitions across the codebase.flow-service/main.ts (3)
21-24: LGTM: Well-designed initial logger setupThe initial logger setup with default configuration ensures logging is available immediately during service startup before the full configuration is loaded.
41-61: LGTM: Proper logger reinitialization with error handlingThe second phase logger reinitialization with service-extracted configuration is well-implemented. The error handling properly logs issues while allowing the service to continue with the default logger configuration if extraction fails.
30-38: LGTM: Structured error handling implementationThe use of
handleCaughtErrorwith structuredLogContextprovides consistent and detailed error reporting for configuration failures.flow-service/src/utils/startup-logger.ts (4)
10-12: LGTM: Component logger integrationThe migration from direct console logging to the structured component logger system significantly improves logging consistency and aligns with the overall logging system refactoring.
20-23: LGTM: Proper initialization validationAdding validation for service configuration initialization with appropriate error logging and process exit ensures the logger functions operate with valid configuration.
40-59: LGTM: Dynamic logging configuration reportingThe dynamic retrieval and reporting of logging channel configurations (console, file, sentry) with proper error handling provides accurate runtime status information and aligns with the structured logging approach.
79-83: LGTM: Enhanced URL logging with dynamic configurationThe dynamic scheme retrieval with fallback and migration to component logger improves both flexibility and consistency of startup URL reporting.
flow-service/src/config/resolution/service-config-resolver.ts (3)
11-17: LGTM - Updated imports align with logging refactor.The import changes properly use the new centralized
logger-types.tsand component logger utility. The logger instantiation follows the established pattern for component-scoped logging.
88-96: Excellent error handling consolidation.The refactored error handling eliminates code duplication and properly wraps non-ConfigError exceptions with cause chaining, improving error context preservation and debugging.
98-99: LGTM - Explicit initialization state management.Marking the service config accessor as initialized provides clear coordination with the startup sequence and logging configuration extraction process.
flow-service/src/config/config-types.ts (3)
9-9: Good centralization of LogLevel type.Importing
LogLevelfrom the centralized logger types ensures consistency across the codebase and eliminates type duplication.
24-24: Consistent type usage for log level property.Using the centralized
LogLeveltype ensures consistency with the broader logging infrastructure.
86-87: New service configuration properties properly typed.The addition of
fsvc:defaultRightsandfsvc:defaultRightsHolderproperties extends the service configuration appropriately with proper typing.flow-core/tests/unit/rdfjs-utils.test.ts (1)
8-74: Comprehensive test coverage for RDF utilities.The test suite properly covers both
relativizeQuadsandexpandRelativeQuadsfunctions with well-structured test cases that verify:
- Correct transformation of namedNode components
- Preservation of literal values
- Proper handling of all quad components (subject, predicate, object, graph)
The test organization and assertions are appropriate and thorough.
flow-core/src/utils/logger/component-logger.ts (2)
7-39: Solid global logger management pattern.The singleton pattern with lazy initialization, configuration injection, and reset capabilities provides excellent flexibility for logger management across the application lifecycle. The fallback to console-only logging when no config is injected ensures the logger always works.
45-53: Clean component name derivation from module metadata.The automatic component name extraction from
import.meta.urlprovides meaningful logger scoping without manual configuration. The URL parsing is robust with appropriate fallback handling.flow-core/src/utils/sparql-utils.ts (1)
24-26: Good centralized error handling with context.The use of
handleCaughtErrorwith query context provides consistent error handling and good debugging information.Also applies to: 50-52
flow-core/src/utils/logger/formatters.ts (5)
6-6: LGTM! Import path correctly updated.The import has been properly updated to use the centralized
logger-types.tsmodule, aligning with the broader refactoring effort.
22-30: Log levels correctly updated to lowercase.The log level keys have been properly normalized to lowercase, consistent with the new
LogLeveltype definition inlogger-types.ts.
49-54: Default log levels correctly updated to lowercase.The function properly uses lowercase log level strings, maintaining consistency with the new logging system.
91-91: Environment variable correctly updated.The change from
FLOW_VERSIONtoFLOW_SERVICE_VERSIONaligns with the standardized service configuration across the codebase.
117-123: Console formatting correctly handles lowercase levels.The implementation properly uses lowercase log levels internally while displaying uppercase text for better console readability. All log level cases are appropriately handled.
flow-core/src/utils/logger/logger-types.ts (3)
76-80: SPARQL context appropriately added.The new
sparqlContextproperty follows the established pattern for context properties and will be useful for debugging SPARQL operations.
174-243: Well-structured channel configuration interfaces.The configuration interfaces are well-designed with:
- Clear separation between channel types
- Appropriate use of inheritance from
LogChannelConfig- Alignment with ontology-based configuration (fsvc properties)
- Comprehensive file rotation and retention options
245-269: Clean separation of Sentry configuration.Good architectural decision to separate Sentry's general configuration from its logging channel configuration. The deprecation notice for
LoggerConfigis clear and helpful for migration.flow-service/src/config/resolution/service-config-accessor.ts (3)
11-24: Initialization state tracking properly implemented.The
initializedflag and its accessor methods provide useful state management for the configuration lifecycle.
25-47: Well-designed generic configuration accessors.The generic
getConfigValueandgetMultipleConfigValuesmethods provide a clean abstraction over SPARQL queries, properly delegating to utility functions and maintaining consistency.
49-64: Excellent refactoring of configuration accessors.The simplified methods effectively reuse the generic accessors, reducing code duplication while maintaining type safety.
flow-core/src/utils/logger/structured-logger.ts (5)
6-51: Channel-based configuration properly implemented.The constructor correctly establishes default channel configurations with sensible defaults (console enabled, others disabled) while preserving user overrides through the spread operator.
56-115: Log methods correctly updated for lowercase levels.All logging methods consistently use lowercase level strings, maintaining the standardized convention across the codebase.
192-216: Console writing correctly updated.The method appropriately changed to synchronous operation and properly handles all lowercase log levels in the switch statement.
247-266: Sentry writing appropriately updated.The synchronous signature is suitable for Sentry operations, and the method correctly filters for error and critical levels using lowercase strings.
304-349: Enhanced logger methods properly updated.The
errorandcriticalmethods correctly use lowercase level strings while maintaining backward compatibility with Error object handling.
| export const LogLevelValues = { | ||
| debug: 0, | ||
| info: 1, | ||
| warn: 2, | ||
| error: 3, | ||
| critical: 4, | ||
| } as const; |
There was a problem hiding this comment.
Inconsistent log level numeric values across modules.
The LogLevelValues here uses a 0-4 scale, while LogLevels in formatters.ts uses a 10-50 scale. This inconsistency could lead to incorrect log level comparisons.
Consider standardizing on one scale across all modules.
export const LogLevelValues = {
- debug: 0,
- info: 1,
- warn: 2,
- error: 3,
- critical: 4,
+ debug: 10,
+ info: 20,
+ warn: 30,
+ error: 40,
+ critical: 50,
} as const;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const LogLevelValues = { | |
| debug: 0, | |
| info: 1, | |
| warn: 2, | |
| error: 3, | |
| critical: 4, | |
| } as const; | |
| export const LogLevelValues = { | |
| debug: 10, | |
| info: 20, | |
| warn: 30, | |
| error: 40, | |
| critical: 50, | |
| } as const; |
🧰 Tools
🪛 ESLint
[error] 167-167: Unquoted property 'debug' found.
(quote-props)
[error] 168-168: Unquoted property 'info' found.
(quote-props)
[error] 169-169: Unquoted property 'warn' found.
(quote-props)
[error] 170-170: Unquoted property 'error' found.
(quote-props)
[error] 171-171: Unquoted property 'critical' found.
(quote-props)
🤖 Prompt for AI Agents
In flow-core/src/utils/logger/logger-types.ts around lines 166 to 172, the
LogLevelValues object uses a 0-4 numeric scale, which is inconsistent with the
10-50 scale used in formatters.ts. To fix this, update the numeric values in
LogLevelValues to match the 10-50 scale used elsewhere, ensuring all log level
values are standardized across modules for consistent comparisons.
| private getLogLevelValue(level: LogLevel): number { | ||
| const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 }; | ||
| return levels[level] ?? 1; | ||
| } |
There was a problem hiding this comment.
Use LogLevelValues constant instead of inline definition.
The inline level values duplicate and contradict the constants defined elsewhere. This creates maintenance issues and potential bugs.
private getLogLevelValue(level: LogLevel): number {
- const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };
- return levels[level] ?? 1;
+ import { LogLevelValues } from './logger-types.ts';
+ return LogLevelValues[level] ?? LogLevelValues.info;
}However, note that LogLevelValues in logger-types.ts also needs to be aligned with LogLevels in formatters.ts as mentioned in the previous review comment.
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 ESLint
[error] 185-185: Unquoted property 'debug' found.
(quote-props)
[error] 185-185: Unquoted property 'info' found.
(quote-props)
[error] 185-185: Unquoted property 'warn' found.
(quote-props)
[error] 185-185: Unquoted property 'error' found.
(quote-props)
[error] 185-185: Unquoted property 'critical' found.
(quote-props)
🤖 Prompt for AI Agents
In flow-core/src/utils/logger/structured-logger.ts lines 184 to 187, replace the
inline levels object with the existing LogLevelValues constant imported from
logger-types.ts to avoid duplication and inconsistencies. Ensure you import
LogLevelValues properly and use it directly in the getLogLevelValue method.
Also, verify that LogLevelValues in logger-types.ts is consistent with LogLevels
in formatters.ts as per the previous review comment.
There was a problem hiding this comment.
I removed LogLevelValues altogether. But should we re-use LogLevels from formatters.ts @CodeRabbit?
There was a problem hiding this comment.
🧩 Analysis chain
@david-richardson-fluxtailor, let me check the current state of the LogLevels constant in formatters.ts to see if it would be appropriate to reuse.
Yes, you should definitely reuse LogLevels from formatters.ts! Looking at the code, both constants are identical:
formatters.ts:
const LogLevels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };structured-logger.ts (current inline):
const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };This is a perfect case for eliminating duplication. Here's what you should do:
- Export
LogLevelsfrom formatters.ts (if not already exported) - Import and use it in structured-logger.ts:
import { LogLevels } from './formatters.ts';
/**
* Get numeric value for log level comparison
*/
private getLogLevelValue(level: LogLevel): number {
return LogLevels[level] ?? LogLevels.info;
}This approach:
- ✅ Eliminates code duplication
- ✅ Ensures consistency across the logging system
- ✅ Provides a single source of truth for log level values
- ✅ Makes maintenance easier (only one place to update values)
The LogLevels constant in formatters.ts is the natural choice since it's already used there for level comparison in the shouldLog function.
🏁 Script executed:
#!/bin/bash
# Check the LogLevels constant in formatters.ts
grep -A 10 -B 2 "LogLevels" flow-core/src/utils/logger/formatters.ts
Length of output: 901
@david-richardson-fluxtailor, I need to correct my previous response! After checking the actual values, there's a critical discrepancy between the two constants:
formatters.ts LogLevels:
export const LogLevels = {
debug: 10,
info: 20,
warn: 30,
error: 40,
critical: 50,
} as const;structured-logger.ts inline levels:
const levels = { debug: 0, info: 1, warn: 2, error: 3, critical: 4 };These use completely different numeric scales! This inconsistency could cause bugs in log level filtering across the system.
You should definitely use LogLevels from formatters.ts because:
- It's already exported and established - used in the
shouldLogfunction - It uses a scale of 10s - provides room for future intermediate levels
- It's the authoritative source - formatters.ts is where level comparison logic lives
Recommended fix:
import { LogLevels } from './formatters.ts';
/**
* Get numeric value for log level comparison
*/
private getLogLevelValue(level: LogLevel): number {
return LogLevels[level] ?? LogLevels.info;
}This eliminates the duplication AND fixes the numeric inconsistency. The LogLevels constant in formatters.ts should be the single source of truth for all log level numeric values throughout the system.
🧬 Code Graph Analysis Results
Relevant snippets for flow-core/src/utils/logger/structured-logger.ts
From flow-core/src/utils/logger/logger-types.ts (lines 11-83, 89-151, 156, 226-243)
export interface LogContext {
/** Operation being performed (e.g., 'startup', 'config-resolve', 'weave', 'scan', 'api-request') */
operation?: string;
/** Unique identifier for tracking related log entries */
operationId?: string;
/** Component or module generating the log entry */
component?: string;
/** Specific function or method name */
functionName?: string;
/** Current mesh identifier when applicable */
meshId?: string;
/** Current node identifier when applicable */
nodeId?: string;
/** Current mesh name for human-readable context */
meshName?: string;
/** Current node name for human-readable context */
nodeName?: string;
/** Performance metrics for operation timing */
performanceMetrics?: {
startTime?: number;
duration?: number;
memoryUsage?: number;
};
/** Configuration context when dealing with config operations */
configContext?: {
configPath?: string;
configType?: string;
validationStage?: string;
};
/** Error context when logging errors */
errorContext?: {
errorType?: string;
errorCode?: string;
stackTrace?: string;
originalError?: Error;
};
/** API request context for HTTP operations */
apiContext?: {
requestId?: string;
method?: string;
path?: string;
statusCode?: number;
userAgent?: string;
ip?: string;
};
/** Service-specific context */
serviceContext?: {
serviceName?: string;
serviceVersion?: string;
environment?: string;
instanceId?: string;
};
/** SPARQL query context for SPARQL operations */
sparqlContext?: {
query?: string;
};
/** Additional arbitrary metadata */
metadata?: Record<string, unknown>;
}
export interface StructuredLogger {
/**
* Log debug information
* @param message - The log message
* @param context - Optional logging context
* @param meta - Additional metadata
*/
debug(message: string, context?: LogContext, meta?: Record<string, unknown>): void;
/**
* Log informational messages
* @param message - The log message
* @param context - Optional logging context
* @param meta - Additional metadata
*/
info(message: string, context?: LogContext, meta?: Record<string, unknown>): void;
/**
* Log warning messages
* @param message - The log message
* @param context - Optional logging context
* @param meta - Additional metadata
*/
warn(message: string, context?: LogContext, meta?: Record<string, unknown>): void;
/**
* Log error messages
* @param message - The log message
* @param context - Optional logging context
* @param meta - Additional metadata
*/
error(message: string, context?: LogContext, meta?: Record<string, unknown>): void;
/**
* Log critical error messages
* @param message - The log message
* @param context - Optional logging context
* @param meta - Additional metadata
*/
critical(message: string, context?: LogContext, meta?: Record<string, unknown>): void;
/**
* Create a contextual logger with pre-filled context
* @param baseContext - The base context to use for all log entries
* @returns A new logger instance with the base context applied
*/
withContext(baseContext: LogContext): StructuredLogger;
/**
* Create an operation-scoped logger with operation tracking
* @param operationName - Name of the operation
* @param operationId - Optional unique identifier for the operation
* @returns A new logger instance scoped to the operation
*/
forOperation(operationName: string, operationId?: string): StructuredLogger;
/**
* Create a component-scoped logger
* @param componentName - Name of the component
* @returns A new logger instance scoped to the component
*/
forComponent(componentName: string): StructuredLogger;
}
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'critical';
export interface LoggingConfig {
/** Console logging channel configuration (fsvc:hasConsoleChannel) */
consoleChannel?: ConsoleChannelConfig;
/** File logging channel configuration (fsvc:hasFileChannel) */
fileChannel?: FileChannelConfig;
/** Sentry logging channel configuration (fsvc:hasSentryChannel) */
sentryChannel?: SentryChannelConfig;
/** Service context applied to all logs */
serviceContext?: {
serviceName: string;
serviceVersion: string;
environment: string;
instanceId?: string;
};
}From flow-core/src/utils/logger/formatters.ts (lines 49-54, 74-98, 107-147, 196-250)
export function shouldLog(level: LogLevel): boolean {
const configLevel = Deno.env.get('FLOW_LOG_LEVEL') ||
(Deno.env.get('FLOW_ENV') !== 'production' ? 'debug' : 'info');
const currentLevel = LogLevels[configLevel as LogLevel] || LogLevels.info;
return LogLevels[level] >= currentLevel;
}
export function formatStructuredMessage(
level: LogLevel,
message: string,
context?: LogContext,
serviceContext?: {
serviceName?: string;
serviceVersion?: string;
environment?: string;
instanceId?: string;
},
): string {
const timestamp = new Date().toISOString();
const baseEntry = {
timestamp,
level: level.toLowerCase(),
message,
service: serviceContext?.serviceName || 'flow-service',
version: serviceContext?.serviceVersion || Deno.env.get('FLOW_SERVICE_VERSION'),
environment: serviceContext?.environment || Deno.env.get('FLOW_ENV') || 'development',
instanceId: serviceContext?.instanceId,
...context,
};
return JSON.stringify(baseEntry);
}
export function formatConsoleMessage(
level: LogLevel,
message: string,
context?: LogContext,
): string {
const isDevelopment = Deno.env.get('FLOW_ENV') !== 'production';
const timestamp = new Date().toISOString();
const prefix = `[${timestamp}] ${level.padEnd(5)}`;
if (isDevelopment) {
const coloredLevel = level === 'error' || level === 'critical'
? colorize('red', level.toUpperCase())
: level === 'warn'
? colorize('yellow', level.toUpperCase())
: level === 'debug'
? colorize('blue', level.toUpperCase())
: colorize('green', level.toUpperCase());
const coloredPrefix = colorize('gray', `[${timestamp}]`) +
` ${coloredLevel.padEnd(5)}`;
let contextStr = '';
if (context && Object.keys(context).length > 0) {
const parts = [];
if (context.operation) parts.push(`op=${context.operation}`);
if (context.meshId) parts.push(`mesh=${context.meshId}`);
if (context.performanceMetrics?.duration) parts.push(`${context.performanceMetrics.duration}ms`);
if (context.metadata?.nodeCount) parts.push(`${context.metadata.nodeCount} nodes`);
if (context.component) parts.push(`[${context.component}]`);
if (context.operationId) parts.push(`id=${context.operationId}`);
contextStr = parts.length > 0 ? ` (${parts.join(', ')})` : '';
}
return `${coloredPrefix} ${message}${contextStr}`;
}
return context
? `${prefix} ${message} ${JSON.stringify(context)}`
: `${prefix} ${message}`;
}
export function mergeLogContext(...contexts: (LogContext | undefined)[]): LogContext {
const result: LogContext = {};
for (const context of contexts) {
if (!context) continue;
// Simple properties - later values override
Object.assign(result, context);
// Special handling for nested objects
if (context.performanceMetrics) {
result.performanceMetrics = {
...result.performanceMetrics,
...context.performanceMetrics,
};
}
if (context.configContext) {
result.configContext = {
...result.configContext,
...context.configContext,
};
}
if (context.errorContext) {
result.errorContext = {
...result.errorContext,
...context.errorContext,
};
}
if (context.apiContext) {
result.apiContext = {
...result.apiContext,
...context.apiContext,
};
}
if (context.serviceContext) {
result.serviceContext = {
...result.serviceContext,
...context.serviceContext,
};
}
if (context.metadata) {
result.metadata = {
...result.metadata,
...context.metadata,
};
}
}
return result;
}From flow-core/src/utils/logger/file-logger.ts (lines 189-194)
export async function getGlobalFileLogger(): Promise<FileLogger | null> {
if (globalFileLogger === null) {
globalFileLogger = createFileLogger();
}
return await globalFileLogger;
}From flow-core/src/utils/logger/sentry-logger.ts (lines 79-81, 90-151, 159-178)
export function isSentryEnabled(): boolean {
return sentryInitialized;
}
export function reportErrorToSentry(
error: Error,
level: LogLevel,
context?: LogContext,
message?: string,
): void {
if (!sentryInitialized) return;
try {
const sentryLevel = mapLogLevelToSentry(level);
const errorContext = extractErrorContext(context);
Sentry.captureException(error, {
level: sentryLevel,
tags: {
source: 'flow-platform',
component: context?.component,
operation: context?.operation,
meshId: context?.meshId,
nodeId: context?.nodeId,
},
extra: {
message: message || error.message,
operationId: context?.operationId,
functionName: context?.functionName,
...errorContext,
...context?.metadata,
},
contexts: {
operation: {
name: context?.operation,
id: context?.operationId,
startTime: context?.performanceMetrics?.startTime,
duration: context?.performanceMetrics?.duration,
},
mesh: {
id: context?.meshId,
name: context?.meshName,
},
node: {
id: context?.nodeId,
name: context?.nodeName,
},
api: context?.apiContext ? {
requestId: context.apiContext.requestId,
method: context.apiContext.method,
path: context.apiContext.path,
statusCode: context.apiContext.statusCode,
userAgent: context.apiContext.userAgent,
ip: context.apiContext.ip,
} : undefined,
config: context?.configContext ? {
configPath: context.configContext.configPath,
configType: context.configContext.configType,
validationStage: context.configContext.validationStage,
} : undefined,
},
});
} catch (err) {
console.error(`Failed to report error to Sentry: ${err}`);
}
}
export function reportMessageToSentry(
message: string,
level: LogLevel,
context?: LogContext,
): void {
if (!sentryInitialized) return;
try {
const sentryLevel = mapLogLevelToSentry(level);
Sentry.captureMessage(message, sentryLevel);
if (context) {
const contextKey = `${level.toLowerCase()}_context`;
Sentry.setContext(contextKey, extractErrorContext(context));
}
} catch (err) {
console.error(`Failed to send message to Sentry: ${err}`);
}
}Summary of relevance:
- The
LogLeveltype andLoggingConfiginterface define the log levels and configuration used instructured-logger.ts. - The
shouldLogfunction fromformatters.tsis used to determine if a message should be logged based on the current environment and log level. - The
mergeLogContextfunction merges multiple log contexts, which is used in the logger to combine base context, message context, and metadata. - The
formatConsoleMessageandformatStructuredMessagefunctions format log messages for console and file outputs respectively. - The
getGlobalFileLoggerfunction provides the file logger instance used for file channel logging. - The
isSentryEnabled,reportErrorToSentry, andreportMessageToSentryfunctions handle Sentry integration for error and message reporting. - The
StructuredLoggerinterface defines the logger methods implemented byStructuredLoggerImpl. - The
LogContextinterface defines the shape of the context objects used throughout the logger.
These snippets provide the types, utility functions, and external dependencies that the structured-logger.ts file relies on, and are relevant to understanding the usage and potential reuse of LogLevels or LogLevel definitions mentioned in the user comment.
| console.log("COPIED QUADS:"); | ||
| for await (const q of stream as any) { | ||
| console.log(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Use structured logging instead of console.log
The debug logging enhancement aligns with the PR objectives, but consider using the structured logger system being introduced elsewhere instead of direct console.log calls. Also, this verbose logging should be conditional or at debug level to avoid cluttering production logs.
- console.log("COPIED QUADS:");
+ // Use structured logger when available
+ // logger.debug("COPIED QUADS:");- console.log(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`);
+ // logger.debug(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| console.log("COPIED QUADS:"); | |
| for await (const q of stream as any) { | |
| console.log(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`); | |
| // Use structured logger when available | |
| // logger.debug("COPIED QUADS:"); | |
| for await (const q of stream as any) { | |
| // logger.debug(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`); |
🤖 Prompt for AI Agents
In flow-core/src/utils/quadstore/quadstore-utils.ts around lines 65 to 67,
replace the direct console.log calls with the project's structured logger system
to maintain consistency and better log management. Ensure the logging is
conditional or set at the debug level so that verbose output does not clutter
production logs. Use the appropriate logger method for debug-level messages and
include relevant context in the log entries.
| const subject = quad.subject.termType === 'NamedNode' ? quad.subject.value.replace(baseIRI, '') : quad.subject.value; | ||
| const predicate = quad.predicate.termType === 'NamedNode' ? quad.predicate.value.replace(baseIRI, '') : quad.predicate.value; | ||
| let object; | ||
| if (quad.object.termType === 'NamedNode') { | ||
| object = df.namedNode(quad.object.value.replace(baseIRI, '')); | ||
| } else if (quad.object.termType === 'Literal') { | ||
| object = df.literal(quad.object.value, quad.object.datatype); | ||
| } else { | ||
| object = quad.object; | ||
| } | ||
| const graph = quad.graph && quad.graph.termType === 'NamedNode' ? df.namedNode(quad.graph.value.replace(baseIRI, '')) : quad.graph.termType === 'DefaultGraph' ? df.defaultGraph() : undefined; |
There was a problem hiding this comment.
Use startsWith() check before replacing to ensure correct prefix removal
The replace() method replaces the first occurrence anywhere in the string, not necessarily at the beginning. This could lead to incorrect IRI transformations if the baseIRI appears elsewhere in the value.
Apply this diff to ensure baseIRI is only removed when it's a prefix:
- const subject = quad.subject.termType === 'NamedNode' ? quad.subject.value.replace(baseIRI, '') : quad.subject.value;
- const predicate = quad.predicate.termType === 'NamedNode' ? quad.predicate.value.replace(baseIRI, '') : quad.predicate.value;
+ const subject = quad.subject.termType === 'NamedNode' && quad.subject.value.startsWith(baseIRI) ? quad.subject.value.slice(baseIRI.length) : quad.subject.value;
+ const predicate = quad.predicate.termType === 'NamedNode' && quad.predicate.value.startsWith(baseIRI) ? quad.predicate.value.slice(baseIRI.length) : quad.predicate.value;
let object;
if (quad.object.termType === 'NamedNode') {
- object = df.namedNode(quad.object.value.replace(baseIRI, ''));
+ const objectValue = quad.object.value.startsWith(baseIRI) ? quad.object.value.slice(baseIRI.length) : quad.object.value;
+ object = df.namedNode(objectValue);
} else if (quad.object.termType === 'Literal') {
object = df.literal(quad.object.value, quad.object.datatype);
} else {
object = quad.object;
}
- const graph = quad.graph && quad.graph.termType === 'NamedNode' ? df.namedNode(quad.graph.value.replace(baseIRI, '')) : quad.graph.termType === 'DefaultGraph' ? df.defaultGraph() : undefined;
+ const graph = quad.graph && quad.graph.termType === 'NamedNode' && quad.graph.value.startsWith(baseIRI) ? df.namedNode(quad.graph.value.slice(baseIRI.length)) : quad.graph.termType === 'DefaultGraph' ? df.defaultGraph() : undefined;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const subject = quad.subject.termType === 'NamedNode' ? quad.subject.value.replace(baseIRI, '') : quad.subject.value; | |
| const predicate = quad.predicate.termType === 'NamedNode' ? quad.predicate.value.replace(baseIRI, '') : quad.predicate.value; | |
| let object; | |
| if (quad.object.termType === 'NamedNode') { | |
| object = df.namedNode(quad.object.value.replace(baseIRI, '')); | |
| } else if (quad.object.termType === 'Literal') { | |
| object = df.literal(quad.object.value, quad.object.datatype); | |
| } else { | |
| object = quad.object; | |
| } | |
| const graph = quad.graph && quad.graph.termType === 'NamedNode' ? df.namedNode(quad.graph.value.replace(baseIRI, '')) : quad.graph.termType === 'DefaultGraph' ? df.defaultGraph() : undefined; | |
| const subject = | |
| quad.subject.termType === 'NamedNode' && quad.subject.value.startsWith(baseIRI) | |
| ? quad.subject.value.slice(baseIRI.length) | |
| : quad.subject.value; | |
| const predicate = | |
| quad.predicate.termType === 'NamedNode' && quad.predicate.value.startsWith(baseIRI) | |
| ? quad.predicate.value.slice(baseIRI.length) | |
| : quad.predicate.value; | |
| let object; | |
| if (quad.object.termType === 'NamedNode') { | |
| const objectValue = | |
| quad.object.value.startsWith(baseIRI) | |
| ? quad.object.value.slice(baseIRI.length) | |
| : quad.object.value; | |
| object = df.namedNode(objectValue); | |
| } else if (quad.object.termType === 'Literal') { | |
| object = df.literal(quad.object.value, quad.object.datatype); | |
| } else { | |
| object = quad.object; | |
| } | |
| const graph = | |
| quad.graph && | |
| quad.graph.termType === 'NamedNode' && | |
| quad.graph.value.startsWith(baseIRI) | |
| ? df.namedNode(quad.graph.value.slice(baseIRI.length)) | |
| : quad.graph.termType === 'DefaultGraph' | |
| ? df.defaultGraph() | |
| : undefined; |
🧰 Tools
🪛 ESLint
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
🤖 Prompt for AI Agents
In flow-core/src/utils/rdfjs-utils.ts around lines 40 to 50, the code uses
replace() to remove baseIRI from values, which can incorrectly remove baseIRI if
it appears anywhere in the string. Update the code to first check if the value
startsWith baseIRI, and only then remove the prefix by slicing it off. Apply
this startsWith check before replacing for subject, predicate, object (when
NamedNode), and graph values to ensure correct prefix removal.
| logRetentionDays: logRetentionDays ? parseInt(logRetentionDays) : 30, | ||
| logMaxFiles: logMaxFiles ? parseInt(logMaxFiles) : 10, | ||
| logMaxFileSize: logMaxFileSize ? parseInt(logMaxFileSize) : 10485760, // 10MB |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add validation for parsed integer values
The parseInt() calls could return NaN for invalid input, which might cause issues in the logging system. Consider validating the parsed values.
- logRetentionDays: logRetentionDays ? parseInt(logRetentionDays) : 30,
- logMaxFiles: logMaxFiles ? parseInt(logMaxFiles) : 10,
- logMaxFileSize: logMaxFileSize ? parseInt(logMaxFileSize) : 10485760, // 10MB
+ logRetentionDays: logRetentionDays ? (Number.isNaN(parseInt(logRetentionDays)) ? 30 : Math.max(1, parseInt(logRetentionDays))) : 30,
+ logMaxFiles: logMaxFiles ? (Number.isNaN(parseInt(logMaxFiles)) ? 10 : Math.max(1, parseInt(logMaxFiles))) : 10,
+ logMaxFileSize: logMaxFileSize ? (Number.isNaN(parseInt(logMaxFileSize)) ? 10485760 : Math.max(1024, parseInt(logMaxFileSize))) : 10485760, // 10MB📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| logRetentionDays: logRetentionDays ? parseInt(logRetentionDays) : 30, | |
| logMaxFiles: logMaxFiles ? parseInt(logMaxFiles) : 10, | |
| logMaxFileSize: logMaxFileSize ? parseInt(logMaxFileSize) : 10485760, // 10MB | |
| logRetentionDays: logRetentionDays | |
| ? (Number.isNaN(parseInt(logRetentionDays)) | |
| ? 30 | |
| : Math.max(1, parseInt(logRetentionDays))) | |
| : 30, | |
| logMaxFiles: logMaxFiles | |
| ? (Number.isNaN(parseInt(logMaxFiles)) | |
| ? 10 | |
| : Math.max(1, parseInt(logMaxFiles))) | |
| : 10, | |
| logMaxFileSize: logMaxFileSize | |
| ? (Number.isNaN(parseInt(logMaxFileSize)) | |
| ? 10485760 | |
| : Math.max(1024, parseInt(logMaxFileSize))) | |
| : 10485760, // 10MB |
🧰 Tools
🪛 ESLint
[error] 92-92: Unquoted property 'logRetentionDays' found.
(quote-props)
[error] 93-93: Unquoted property 'logMaxFiles' found.
(quote-props)
[error] 94-94: Unquoted property 'logMaxFileSize' found.
(quote-props)
🤖 Prompt for AI Agents
In flow-service/src/config/logging-config-extractor.ts around lines 92 to 94,
the parseInt calls for logRetentionDays, logMaxFiles, and logMaxFileSize may
return NaN if the input is invalid. To fix this, validate each parsed integer by
checking if it is a valid number; if not, fall back to the default values (30,
10, and 10485760 respectively). This ensures the logging configuration always
uses valid numeric values.
| private async getConfigValueFromSparql(sparql: string, variable: string): Promise<string | undefined> { | ||
| if (!this.bundle.engine) { | ||
| throw new Error('SPARQL engine not initialized in Quadstore bundle'); | ||
| } | ||
| const values: string[] = []; | ||
| const bindingsStream = await this.bundle.engine.queryBindings(sparql, { sources: [this.bundle.store] }); | ||
| for await (const binding of bindingsStream as any) { | ||
| const value = binding.get('value'); | ||
| if (value) { | ||
| values.push(value.value); | ||
| try { | ||
| const bindingsStream = await this.bundle.engine.queryBindings(sparql, { sources: [this.bundle.store] }); | ||
| for await (const binding of bindingsStream as any) { | ||
| const value = binding.get(variable); | ||
| if (value) { | ||
| return value.value; | ||
| } | ||
| } | ||
| } catch (error) { | ||
| throw new Error(`Failed to execute SPARQL query: ${error instanceof Error ? error.message : String(error)}`); | ||
| } | ||
| return values; | ||
| return undefined; | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Avoid using any type assertion.
The as any type assertion on line 122 bypasses TypeScript's type safety.
Consider properly typing the bindings stream or using a type guard instead of as any. If the exact type is complex, at least use a more specific type than any.
🧰 Tools
🪛 ESLint
[error] 118-118: Strings must use doublequote.
(quotes)
[error] 121-121: Unquoted property 'sources' found.
(quote-props)
🤖 Prompt for AI Agents
In flow-service/src/config/resolution/service-config-accessor.ts between lines
116 and 132, the use of 'as any' to type assert the bindings stream bypasses
TypeScript's type safety. To fix this, replace 'as any' with a proper type
annotation that matches the expected type of the bindings stream returned by
this.bundle.engine.queryBindings, or implement a type guard to safely handle the
stream's items. This will ensure type safety without losing type information.
| logMaxFileSize: parseInt(Deno.env.get('FLOW_LOG_MAX_FILE_SIZE') || '10485760'), // 10MB | ||
| logMaxFiles: parseInt(Deno.env.get('FLOW_LOG_MAX_FILES') || '5'), |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add validation for parsed integer configuration values
Similar to the logging config extractor, the parseInt() calls here could return NaN for invalid environment variables.
- logMaxFileSize: parseInt(Deno.env.get('FLOW_LOG_MAX_FILE_SIZE') || '10485760'), // 10MB
- logMaxFiles: parseInt(Deno.env.get('FLOW_LOG_MAX_FILES') || '5'),
+ logMaxFileSize: (() => {
+ const size = parseInt(Deno.env.get('FLOW_LOG_MAX_FILE_SIZE') || '10485760');
+ return Number.isNaN(size) ? 10485760 : Math.max(1024, size);
+ })(),
+ logMaxFiles: (() => {
+ const files = parseInt(Deno.env.get('FLOW_LOG_MAX_FILES') || '5');
+ return Number.isNaN(files) ? 5 : Math.max(1, files);
+ })(),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| logMaxFileSize: parseInt(Deno.env.get('FLOW_LOG_MAX_FILE_SIZE') || '10485760'), // 10MB | |
| logMaxFiles: parseInt(Deno.env.get('FLOW_LOG_MAX_FILES') || '5'), | |
| logMaxFileSize: (() => { | |
| const size = parseInt(Deno.env.get('FLOW_LOG_MAX_FILE_SIZE') || '10485760'); | |
| return Number.isNaN(size) ? 10485760 : Math.max(1024, size); | |
| })(), | |
| logMaxFiles: (() => { | |
| const files = parseInt(Deno.env.get('FLOW_LOG_MAX_FILES') || '5'); | |
| return Number.isNaN(files) ? 5 : Math.max(1, files); | |
| })(), |
🧰 Tools
🪛 ESLint
[error] 45-45: Unquoted property 'logMaxFileSize' found.
(quote-props)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 46-46: Unquoted property 'logMaxFiles' found.
(quote-props)
[error] 46-46: Strings must use doublequote.
(quotes)
[error] 46-46: Strings must use doublequote.
(quotes)
🤖 Prompt for AI Agents
In flow-service/src/utils/service-logger.ts around lines 45 to 46, the parseInt
calls for environment variables FLOW_LOG_MAX_FILE_SIZE and FLOW_LOG_MAX_FILES
can return NaN if the values are invalid. Add validation after parsing to check
if the result is NaN, and if so, fallback to the default values (10485760 for
max file size and 5 for max files) to ensure valid numeric configuration.
…ce constants for consistency
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (3)
flow-core/src/utils/rdfjs-utils.ts (1)
39-58: Fix unsafe string replacement in relativizeQuads.The
replace()method removes the first occurrence ofbaseIRIanywhere in the string, not necessarily at the beginning. This could incorrectly transform IRIs if thebaseIRIappears elsewhere in the value.Apply this diff to ensure baseIRI is only removed when it's a prefix:
- const subject = quad.subject.termType === 'NamedNode' ? quad.subject.value.replace(baseIRI, '') : quad.subject.value; - const predicate = quad.predicate.termType === 'NamedNode' ? quad.predicate.value.replace(baseIRI, '') : quad.predicate.value; + const subject = quad.subject.termType === 'NamedNode' && quad.subject.value.startsWith(baseIRI) ? quad.subject.value.slice(baseIRI.length) : quad.subject.value; + const predicate = quad.predicate.termType === 'NamedNode' && quad.predicate.value.startsWith(baseIRI) ? quad.predicate.value.slice(baseIRI.length) : quad.predicate.value; let object; if (quad.object.termType === 'NamedNode') { - object = df.namedNode(quad.object.value.replace(baseIRI, '')); + const objectValue = quad.object.value.startsWith(baseIRI) ? quad.object.value.slice(baseIRI.length) : quad.object.value; + object = df.namedNode(objectValue); } else if (quad.object.termType === 'Literal') { object = df.literal(quad.object.value, quad.object.datatype); } else { object = quad.object; } - const graph = quad.graph && quad.graph.termType === 'NamedNode' ? df.namedNode(quad.graph.value.replace(baseIRI, '')) : quad.graph.termType === 'DefaultGraph' ? df.defaultGraph() : undefined; + const graph = quad.graph && quad.graph.termType === 'NamedNode' && quad.graph.value.startsWith(baseIRI) ? df.namedNode(quad.graph.value.slice(baseIRI.length)) : quad.graph.termType === 'DefaultGraph' ? df.defaultGraph() : undefined;flow-service/src/utils/service-logger.ts (1)
45-46: Add validation for parsed integer configuration values.The
parseInt()calls for environment variablesFLOW_LOG_MAX_FILE_SIZEandFLOW_LOG_MAX_FILEScan returnNaNfor invalid values, which could cause runtime issues in file logging operations.flow-service/src/config/resolution/service-config-accessor.ts (1)
116-133: Address the type safety issue with bindings stream.The method has good error handling and null checking patterns. However, the
as anytype assertion on line 123 still bypasses TypeScript's type safety as noted in previous reviews.Consider properly typing the bindings stream or using a type guard instead of
as any. If the exact type is complex, at least use a more specific type thanany.
🧹 Nitpick comments (2)
flow-service/src/config/resolution/service-config-accessor.ts (2)
68-114: LGTM! Well-structured logging configuration methods.The three logging configuration methods follow a consistent pattern and provide appropriate return types for the logging system integration. The SPARQL queries correctly handle optional log levels.
Consider extracting the common pattern into a private helper method to reduce code duplication:
private async getLoggingChannelConfig(channelProperty: string): Promise<{ enabled: boolean; level?: string }> { const sparql = ` PREFIX fsvc: <https://semantic-flow.github.io/ontology/flow-service/> SELECT ?enabled ?level WHERE { GRAPH <${getCurrentServiceUri(CONFIG_GRAPH_NAMES.mergedServiceConfig)}> { ?s ${channelProperty} ?channel . ?channel fsvc:logChannelEnabled ?enabled . OPTIONAL { ?channel fsvc:logLevel ?level . } } } `; const enabledStr = await this.getConfigValueFromSparql(sparql, "enabled"); const level = await this.getConfigValueFromSparql(sparql, "level"); return { enabled: enabledStr === "true", level: level ?? undefined }; }Then simplify the public methods:
async getConsoleLoggingConfig(): Promise<{ enabled: boolean; level?: string }> { return await this.getLoggingChannelConfig("fsvc:hasConsoleChannel"); }
1-137: Fix ESLint violations for code consistency.Multiple ESLint violations throughout the file related to quote consistency and property quoting. These should be addressed to maintain codebase standards.
Run ESLint with auto-fix to resolve the formatting issues:
eslint --fix flow-service/src/config/resolution/service-config-accessor.tsThe main issues are:
- Inconsistent quote usage (should use double quotes)
- Unquoted object properties (should be quoted consistently)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
flow-core/src/deps.ts(2 hunks)flow-core/src/utils/logger/error-handlers.ts(6 hunks)flow-core/src/utils/logger/index.ts(4 hunks)flow-core/src/utils/logger/logger-types.ts(3 hunks)flow-core/src/utils/quadstore/quadstore-utils.ts(3 hunks)flow-core/src/utils/rdfjs-utils.ts(2 hunks)flow-core/src/utils/sparql-utils.ts(1 hunks)flow-service/src/config/loaders/quadstore-loader.ts(3 hunks)flow-service/src/config/resolution/service-config-accessor.ts(1 hunks)flow-service/src/config/resolution/service-config-resolver.ts(6 hunks)flow-service/src/service-constants.ts(1 hunks)flow-service/src/utils/service-logger.ts(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- flow-core/src/deps.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
flow-core/src/utils/logger/index.ts (3)
flow-core/src/utils/logger/types.ts (3)
LoggerConfig(163-199)StructuredLogger(84-146)LogContext(11-78)flow-core/src/utils/logger/structured-logger.ts (4)
StructuredLoggerImpl(24-272)updateConfig(269-271)EnhancedStructuredLogger(277-323)constructor(33-41)flow-service/src/config/config-types.ts (2)
LoggingConfig(38-43)LogChannelConfig(20-36)
🪛 ESLint
flow-service/src/config/resolution/service-config-accessor.ts
[error] 2-2: Strings must use doublequote.
(quotes)
[error] 3-3: Strings must use doublequote.
(quotes)
[error] 4-4: Strings must use doublequote.
(quotes)
[error] 5-5: Strings must use doublequote.
(quotes)
[error] 6-6: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 55-55: Strings must use doublequote.
(quotes)
[error] 59-59: Strings must use doublequote.
(quotes)
[error] 63-63: Strings must use doublequote.
(quotes)
[error] 79-79: Strings must use doublequote.
(quotes)
[error] 80-80: Strings must use doublequote.
(quotes)
[error] 81-81: Unquoted property 'enabled' found.
(quote-props)
[error] 81-81: Strings must use doublequote.
(quotes)
[error] 81-81: Unquoted property 'level' found.
(quote-props)
[error] 95-95: Strings must use doublequote.
(quotes)
[error] 96-96: Strings must use doublequote.
(quotes)
[error] 97-97: Unquoted property 'enabled' found.
(quote-props)
[error] 97-97: Strings must use doublequote.
(quotes)
[error] 97-97: Unquoted property 'level' found.
(quote-props)
[error] 111-111: Strings must use doublequote.
(quotes)
[error] 112-112: Strings must use doublequote.
(quotes)
[error] 113-113: Unquoted property 'enabled' found.
(quote-props)
[error] 113-113: Strings must use doublequote.
(quotes)
[error] 113-113: Unquoted property 'level' found.
(quote-props)
[error] 118-118: Strings must use doublequote.
(quotes)
[error] 121-121: Unquoted property 'sources' found.
(quote-props)
flow-core/src/utils/logger/logger-types.ts
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 174-174: Strings must use doublequote.
(quotes)
[error] 174-174: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/error-handlers.ts
[error] 7-7: Strings must use doublequote.
(quotes)
[error] 437-446: Unquoted property 'handleError' found.
(quote-props)
[error] 448-456: Unquoted property 'handleCaughtError' found.
(quote-props)
[error] 458-466: Unquoted property 'withErrorHandling' found.
(quote-props)
flow-core/src/utils/logger/index.ts
[error] 20-20: Strings must use doublequote.
(quotes)
[error] 22-22: Strings must use doublequote.
(quotes)
[error] 23-23: Strings must use doublequote.
(quotes)
[error] 70-70: Strings must use doublequote.
(quotes)
[error] 86-90: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 87-87: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 88-88: Unquoted property 'logLevel' found.
(quote-props)
[error] 88-88: Strings must use doublequote.
(quotes)
[error] 89-89: Unquoted property 'logFormat' found.
(quote-props)
[error] 89-89: Strings must use doublequote.
(quotes)
[error] 91-96: Unquoted property 'fileChannel' found.
(quote-props)
[error] 92-92: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 93-93: Unquoted property 'logLevel' found.
(quote-props)
[error] 93-93: Strings must use doublequote.
(quotes)
[error] 94-94: Unquoted property 'logFormat' found.
(quote-props)
[error] 94-94: Strings must use doublequote.
(quotes)
[error] 95-95: Unquoted property 'logFilePath' found.
(quote-props)
[error] 95-95: Strings must use doublequote.
(quotes)
[error] 97-100: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 98-98: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 99-99: Unquoted property 'logLevel' found.
(quote-props)
[error] 99-99: Strings must use doublequote.
(quotes)
[error] 129-133: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 130-130: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 131-131: Unquoted property 'logLevel' found.
(quote-props)
[error] 131-131: Strings must use doublequote.
(quotes)
[error] 132-132: Unquoted property 'logFormat' found.
(quote-props)
[error] 132-132: Strings must use doublequote.
(quotes)
[error] 134-139: Unquoted property 'fileChannel' found.
(quote-props)
[error] 135-135: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 136-136: Unquoted property 'logLevel' found.
(quote-props)
[error] 136-136: Strings must use doublequote.
(quotes)
[error] 137-137: Unquoted property 'logFormat' found.
(quote-props)
[error] 137-137: Strings must use doublequote.
(quotes)
[error] 138-138: Unquoted property 'logFilePath' found.
(quote-props)
[error] 138-138: Strings must use doublequote.
(quotes)
[error] 140-143: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 141-141: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 142-142: Unquoted property 'logLevel' found.
(quote-props)
[error] 142-142: Strings must use doublequote.
(quotes)
flow-core/src/utils/quadstore/quadstore-utils.ts
[error] 6-6: Strings must use doublequote.
(quotes)
flow-core/src/utils/rdfjs-utils.ts
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 50-50: Strings must use doublequote.
(quotes)
[error] 52-52: Strings must use doublequote.
(quotes)
[error] 53-53: Strings must use doublequote.
(quotes)
[error] 72-72: Strings must use doublequote.
(quotes)
[error] 73-73: Strings must use doublequote.
(quotes)
[error] 77-77: Strings must use doublequote.
(quotes)
[error] 79-79: Strings must use doublequote.
(quotes)
[error] 84-84: Strings must use doublequote.
(quotes)
[error] 84-84: Strings must use doublequote.
(quotes)
[error] 87-87: Strings must use doublequote.
(quotes)
[error] 88-88: Strings must use doublequote.
(quotes)
flow-core/src/utils/sparql-utils.ts
[error] 2-2: Strings must use doublequote.
(quotes)
[error] 3-3: Strings must use doublequote.
(quotes)
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 18-18: Unquoted property 'sources' found.
(quote-props)
[error] 21-21: Strings must use doublequote.
(quotes)
[error] 30-30: Strings must use doublequote.
(quotes)
[error] 40-40: Strings must use doublequote.
(quotes)
[error] 45-45: Unquoted property 'sources' found.
(quote-props)
[error] 48-48: Strings must use doublequote.
(quotes)
flow-service/src/config/loaders/quadstore-loader.ts
[error] 4-4: Strings must use doublequote.
(quotes)
[error] 5-5: Strings must use doublequote.
(quotes)
[error] 6-6: Strings must use doublequote.
(quotes)
[error] 43-43: Unquoted property 'graphName' found.
(quote-props)
[error] 56-56: Unquoted property 'graphName' found.
(quote-props)
[error] 59-59: Unquoted property 'graphName' found.
(quote-props)
[error] 85-85: Unquoted property 'subject' found.
(quote-props)
[error] 85-85: Unquoted property 'predicate' found.
(quote-props)
[error] 85-85: Unquoted property 'object' found.
(quote-props)
[error] 85-85: Unquoted property 'graph' found.
(quote-props)
[error] 91-91: Unquoted property 'subject' found.
(quote-props)
[error] 91-91: Unquoted property 'predicate' found.
(quote-props)
[error] 91-91: Unquoted property 'object' found.
(quote-props)
[error] 91-91: Unquoted property 'graph' found.
(quote-props)
[error] 93-93: Strings must use doublequote.
(quotes)
[error] 93-93: Strings must use doublequote.
(quotes)
flow-service/src/config/resolution/service-config-resolver.ts
[error] 11-11: Strings must use doublequote.
(quotes)
[error] 12-12: Strings must use doublequote.
(quotes)
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 14-14: Strings must use doublequote.
(quotes)
[error] 26-26: Strings must use doublequote.
(quotes)
[error] 71-71: Strings must use doublequote.
(quotes)
[error] 87-87: Strings must use doublequote.
(quotes)
flow-service/src/service-constants.ts
[error] 8-8: Strings must use doublequote.
(quotes)
flow-service/src/utils/service-logger.ts
[error] 13-13: Strings must use doublequote.
(quotes)
[error] 25-25: Unquoted property 'serviceVersion' found.
(quote-props)
[error] 25-25: Strings must use doublequote.
(quotes)
[error] 26-26: Unquoted property 'environment' found.
(quote-props)
[error] 26-26: Strings must use doublequote.
(quotes)
[error] 26-26: Strings must use doublequote.
(quotes)
[error] 27-27: Unquoted property 'instanceId' found.
(quote-props)
[error] 27-27: Strings must use doublequote.
(quotes)
[error] 34-38: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 35-35: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 36-36: Unquoted property 'logLevel' found.
(quote-props)
[error] 36-36: Strings must use doublequote.
(quotes)
[error] 37-37: Unquoted property 'logFormat' found.
(quote-props)
[error] 37-37: Strings must use doublequote.
(quotes)
[error] 40-48: Unquoted property 'fileChannel' found.
(quote-props)
[error] 41-41: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 41-41: Strings must use doublequote.
(quotes)
[error] 42-42: Unquoted property 'logLevel' found.
(quote-props)
[error] 42-42: Strings must use doublequote.
(quotes)
[error] 43-43: Unquoted property 'logFormat' found.
(quote-props)
[error] 43-43: Strings must use doublequote.
(quotes)
[error] 44-44: Unquoted property 'logFilePath' found.
(quote-props)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 44-44: Strings must use doublequote.
(quotes)
[error] 45-45: Unquoted property 'logMaxFileSize' found.
(quote-props)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 45-45: Strings must use doublequote.
(quotes)
[error] 46-46: Unquoted property 'logMaxFiles' found.
(quote-props)
[error] 46-46: Strings must use doublequote.
(quotes)
[error] 46-46: Strings must use doublequote.
(quotes)
[error] 47-47: Unquoted property 'logRotationInterval' found.
(quote-props)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 47-47: Strings must use doublequote.
(quotes)
[error] 51-51: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 51-51: Strings must use doublequote.
(quotes)
[error] 52-52: Unquoted property 'logLevel' found.
(quote-props)
[error] 52-52: Strings must use doublequote.
(quotes)
[error] 53-53: Unquoted property 'sentryDsn' found.
(quote-props)
[error] 53-53: Strings must use doublequote.
(quotes)
🔇 Additional comments (27)
flow-service/src/service-constants.ts (1)
5-8: LGTM! Good implementation of service instance identification.The service instance ID constant provides essential service context for logging and tracing. The fallback to
crypto.randomUUID()ensures each service instance has a unique identifier even when the environment variable is not set.flow-core/src/utils/rdfjs-utils.ts (1)
61-93: Excellent implementation of absolute URI detection.The
expandRelativeQuadsfunction correctly addresses previous concerns by implementing robust absolute URI detection using regex pattern matching instead of the overly broadstartsWith("http")check.flow-service/src/config/resolution/service-config-resolver.ts (2)
83-95: Improved error handling consolidation.The refactored error handling logic properly distinguishes between
ConfigErrorand other exceptions, eliminating code duplication while ensuring consistent error wrapping and logging.
96-97: Good addition of explicit initialization state management.Marking the service config accessor as initialized provides clear lifecycle management and prevents usage before configuration is ready.
flow-core/src/utils/sparql-utils.ts (2)
8-33: Excellent implementation addressing previous concerns.The
querySingleValuefunction correctly throws an error when multiple results are returned (Line 30), addressing the previous review concern about potentially masking configuration errors. The error handling and logging integration align well with the PR's objectives.
35-57: Clean implementation of multiple values query.The
queryMultipleValuesfunction provides a clear, purpose-built utility for cases where multiple results are expected, complementing the strict single-value function.flow-service/src/utils/service-logger.ts (5)
9-9: LGTM - Import updates align with logging system refactor.The migration from
LoggerConfigtoLoggingConfigand the addition ofFLOW_SERVICE_INSTANCE_IDare consistent with the broader logging system modernization described in the AI summary.Also applies to: 14-14
25-25: LGTM - Improved service context consistency.Using imported constants as fallback values ensures consistent service metadata across the application and improves maintainability.
Also applies to: 27-27
33-57: LGTM - Configuration restructure aligns with new logging architecture.The migration from flat boolean flags to detailed channel-based configuration properly implements the new
LoggingConfiginterface, providing granular control over console, file, and Sentry logging channels.
62-62: LGTM - Logger instance creation updated for new config structure.The logger creation properly uses the updated
SERVICE_LOGGER_DEFAULT_CONFIGwith the new channel-based configuration.
142-142: LGTM - JSDoc documentation updated to reflect current usage.The example
configTypevalues have been updated to match current usage patterns, improving documentation accuracy.flow-service/src/config/loaders/quadstore-loader.ts (3)
4-4: LGTM - Imports updated for RDF utility refactoring and improved logging.The migration to new RDF utility functions (
expandRelativeJsonLd,relativizeQuads,expandRelativeQuads) and the adoption of component-scoped logging viagetComponentLoggeralign with the broader system refactoring.Also applies to: 7-7, 9-11
20-20: LGTM - Systematic migration to new RDF expansion utilities.The replacement of
expandRelativeIdswithexpandRelativeJsonLdacross all loader functions is consistent with the RDF utility refactoring. The dual graph loading inloadInputServiceConfigproperly supports the new merging strategy.Also applies to: 42-42, 54-59, 67-67
85-105: LGTM - Sophisticated quad merging implementation with proper IRI handling.The new implementation properly handles IRI relativization and expansion when moving quads between graphs, with conditional insertion to prevent duplicates. The comprehensive debug logging will be valuable for troubleshooting configuration merging issues.
flow-core/src/utils/logger/index.ts (2)
10-23: LGTM - Improved type organization with proper deprecation handling.The consolidation of logging types into
logger-types.tswith granular channel-specific interfaces improves the architecture. The deprecation ofLoggerConfigwhile maintaining backwards compatibility follows good migration practices.
86-114: LGTM – New channel-based logger configuration is correctly implemented.There is, however, a duplication of
serviceContextin both theLoggingConfigobject and as the second parameter to the logger factory. Please verify whether this is intentional (e.g. for backward-compatibility) or if one instance should be removed to avoid confusion:• File: flow-core/src/utils/logger/index.ts
– Lines 86–114 (createDefaultLogger)
– Lines 129–157 (createDefaultEnhancedLogger)flow-core/src/utils/logger/error-handlers.ts (3)
7-7: LGTM - Import updated to align with type consolidation.The change from
./types.tsto./logger-types.tsis consistent with the broader refactoring to consolidate logging types.
39-39: LGTM - Appropriate lint suppressions for safe error property access.The
deno-lint-ignore no-explicit-anycomments are properly placed for safe type casting when accessing optionalcodeproperties on Error objects.Also applies to: 127-127
437-446: LGTM - Function signature refactoring maintains functionality.The removal of
asynckeywords from the contextual error handler functions while maintaining promise-returning signatures is a stylistic change that doesn't affect functionality.Also applies to: 448-456, 458-466
flow-core/src/utils/logger/logger-types.ts (4)
76-79: LGTM - Logical extension of LogContext for SPARQL operations.The addition of
sparqlContextprovides structured context for SPARQL query logging, which aligns with the platform's RDF/SPARQL capabilities.
154-161: LGTM - Improved log level design with string literals.The migration from numeric enum to lowercase string literal union type (
'debug' | 'info' | 'warn' | 'error' | 'critical') is more intuitive and follows common logging library conventions. ThevalidLogLevelsarray supports validation scenarios.
164-232: LGTM - Well-designed channel-based logging configuration.The hierarchical interface design with
LogChannelConfigas the base and specific channel configs (ConsoleChannelConfig,FileChannelConfig,SentryChannelConfig) provides excellent granular control. The ontology mappings (fsvc: prefixes) demonstrate integration with semantic configuration.
234-258: LGTM - Good separation of concerns and proper deprecation handling.The
SentryConfiginterface for general Sentry features (tracing, debug) separate from logging-specific configuration shows good architectural separation. The deprecation ofLoggerConfigwith clear migration guidance follows best practices.flow-service/src/config/resolution/service-config-accessor.ts (4)
6-6: LGTM! Good modularization of SPARQL utilities.The import of
querySingleValueandqueryMultipleValuesutilities promotes code reuse and centralized SPARQL query handling.
11-23: LGTM! Proper initialization state management.The addition of initialization state tracking with getter/setter methods provides good lifecycle management for the service config accessor.
25-47: LGTM! Good refactoring to generic config access methods.The refactoring to use generic
getConfigValueandgetMultipleConfigValuesmethods with dynamic SPARQL construction is well-designed. The delegation to utility functions promotes code reuse and separation of concerns.The dynamic property injection into SPARQL queries is acceptable here since the properties are controlled by the calling code within the same class.
49-64: LGTM! Consistent and simplified config accessor methods.The refactoring of existing methods to use the generic
getConfigValueapproach creates consistency across the codebase. The newgetSchemeandgetMeshPathsmethods follow the same well-established pattern.
| logger.info("COPIED QUADS:"); | ||
| // deno-lint-ignore no-explicit-any | ||
| for await (const q of stream as any) { | ||
| logger.info(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Use debug level logging for verbose quad output.
The detailed quad logging is now using the structured logger system as requested, but logger.info will clutter production logs. This verbose output should use logger.debug instead.
Apply this diff to use appropriate log level:
- logger.info("COPIED QUADS:");
+ logger.debug("COPIED QUADS:");
// deno-lint-ignore no-explicit-any
for await (const q of stream as any) {
- logger.info(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`);
+ logger.debug(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| logger.info("COPIED QUADS:"); | |
| // deno-lint-ignore no-explicit-any | |
| for await (const q of stream as any) { | |
| logger.info(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`); | |
| logger.debug("COPIED QUADS:"); | |
| // deno-lint-ignore no-explicit-any | |
| for await (const q of stream as any) { | |
| logger.debug(`${q.subject.value} ${q.predicate.value} ${q.object.value} to graph ${targetGraph.value}`); |
🤖 Prompt for AI Agents
In flow-core/src/utils/quadstore/quadstore-utils.ts around lines 70 to 73,
change the logging level from logger.info to logger.debug for the detailed quad
output to prevent cluttering production logs with verbose information. Replace
all logger.info calls in this block with logger.debug to ensure the output is
only visible when debug logging is enabled.
…ate related tests for base URL setup
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
flow-core/src/utils/logger/component-logger.ts (1)
52-55: Improve robustness of component name derivation.The component name derivation could fail with non-standard URLs or missing file extensions. Consider adding more robust parsing and fallback logic.
function deriveComponentName(meta: ImportMeta): string { - const url = new URL(meta.url); - return url.pathname.split("/").pop()?.replace(".ts", "") ?? "unknown"; + try { + const url = new URL(meta.url); + const filename = url.pathname.split("/").pop() ?? "unknown"; + // Handle various file extensions and edge cases + return filename.replace(/\.(ts|js|mts|cts)$/, "") || "unknown"; + } catch { + return "unknown"; + } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
flow-service/logs/test-pretty-direct.logis excluded by!**/*.log
📒 Files selected for processing (5)
flow-core/src/utils/logger/component-logger.ts(1 hunks)flow-core/src/utils/logger/index.ts(4 hunks)flow-core/src/utils/logger/logger-types.ts(3 hunks)flow-service/main.ts(3 hunks)flow-service/tests/integration/meshes-routes.integration.test.ts(1 hunks)
🧰 Additional context used
🪛 ESLint
flow-service/tests/integration/meshes-routes.integration.test.ts
[error] 2-2: Strings must use doublequote.
(quotes)
[error] 3-3: Strings must use doublequote.
(quotes)
[error] 4-4: Strings must use doublequote.
(quotes)
[error] 9-9: Unquoted property 'name' found.
(quote-props)
[error] 9-9: Strings must use doublequote.
(quotes)
[error] 10-19: Unquoted property 'fn' found.
(quote-props)
[error] 14-14: Strings must use doublequote.
(quotes)
[error] 16-16: Strings must use doublequote.
(quotes)
[error] 20-20: Unquoted property 'sanitizeResources' found.
(quote-props)
[error] 21-21: Unquoted property 'sanitizeOps' found.
(quote-props)
[error] 24-24: Strings must use doublequote.
(quotes)
[error] 26-26: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/logger-types.ts
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 156-156: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 161-161: Strings must use doublequote.
(quotes)
[error] 174-174: Strings must use doublequote.
(quotes)
[error] 174-174: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
[error] 201-201: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/component-logger.ts
[error] 33-37: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 34-34: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 35-35: Unquoted property 'logLevel' found.
(quote-props)
[error] 35-35: Strings must use doublequote.
(quotes)
[error] 36-36: Unquoted property 'logFormat' found.
(quote-props)
[error] 36-36: Strings must use doublequote.
(quotes)
flow-core/src/utils/logger/index.ts
[error] 18-18: Strings must use doublequote.
(quotes)
[error] 20-20: Strings must use doublequote.
(quotes)
[error] 21-21: Strings must use doublequote.
(quotes)
[error] 68-68: Strings must use doublequote.
(quotes)
[error] 84-88: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 85-85: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 86-86: Unquoted property 'logLevel' found.
(quote-props)
[error] 86-86: Strings must use doublequote.
(quotes)
[error] 87-87: Unquoted property 'logFormat' found.
(quote-props)
[error] 87-87: Strings must use doublequote.
(quotes)
[error] 89-94: Unquoted property 'fileChannel' found.
(quote-props)
[error] 90-90: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 91-91: Unquoted property 'logLevel' found.
(quote-props)
[error] 91-91: Strings must use doublequote.
(quotes)
[error] 92-92: Unquoted property 'logFormat' found.
(quote-props)
[error] 92-92: Strings must use doublequote.
(quotes)
[error] 93-93: Unquoted property 'logFilePath' found.
(quote-props)
[error] 93-93: Strings must use doublequote.
(quotes)
[error] 95-98: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 96-96: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 97-97: Unquoted property 'logLevel' found.
(quote-props)
[error] 97-97: Strings must use doublequote.
(quotes)
[error] 127-131: Unquoted property 'consoleChannel' found.
(quote-props)
[error] 128-128: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 129-129: Unquoted property 'logLevel' found.
(quote-props)
[error] 129-129: Strings must use doublequote.
(quotes)
[error] 130-130: Unquoted property 'logFormat' found.
(quote-props)
[error] 130-130: Strings must use doublequote.
(quotes)
[error] 132-137: Unquoted property 'fileChannel' found.
(quote-props)
[error] 133-133: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 134-134: Unquoted property 'logLevel' found.
(quote-props)
[error] 134-134: Strings must use doublequote.
(quotes)
[error] 135-135: Unquoted property 'logFormat' found.
(quote-props)
[error] 135-135: Strings must use doublequote.
(quotes)
[error] 136-136: Unquoted property 'logFilePath' found.
(quote-props)
[error] 136-136: Strings must use doublequote.
(quotes)
[error] 138-141: Unquoted property 'sentryChannel' found.
(quote-props)
[error] 139-139: Unquoted property 'logChannelEnabled' found.
(quote-props)
[error] 140-140: Unquoted property 'logLevel' found.
(quote-props)
[error] 140-140: Strings must use doublequote.
(quotes)
flow-service/main.ts
[error] 31-31: Unquoted property 'operation' found.
(quote-props)
[error] 54-54: Unquoted property 'operation' found.
(quote-props)
[error] 68-68: Unquoted property 'operation' found.
(quote-props)
[error] 85-85: Unquoted property 'openapi' found.
(quote-props)
[error] 86-90: Unquoted property 'info' found.
(quote-props)
[error] 87-87: Unquoted property 'version' found.
(quote-props)
[error] 88-88: Unquoted property 'title' found.
(quote-props)
[error] 89-89: Unquoted property 'description' found.
(quote-props)
[error] 91-97: Unquoted property 'servers' found.
(quote-props)
[error] 93-94: Unquoted property 'url' found.
(quote-props)
[error] 95-95: Unquoted property 'description' found.
(quote-props)
[error] 106-106: Unquoted property 'spec' found.
(quote-props)
[error] 106-106: Unquoted property 'url' found.
(quote-props)
[error] 107-107: Unquoted property 'pageTitle' found.
(quote-props)
[error] 108-108: Unquoted property 'theme' found.
(quote-props)
[error] 109-109: Unquoted property 'layout' found.
(quote-props)
[error] 118-118: Unquoted property 'operation' found.
(quote-props)
[error] 148-148: Unquoted property 'operation' found.
(quote-props)
[error] 160-160: Unquoted property 'operation' found.
(quote-props)
[error] 161-164: Unquoted property 'metadata' found.
(quote-props)
[error] 162-163: Unquoted property 'serverEndpoint' found.
(quote-props)
🔇 Additional comments (13)
flow-service/main.ts (3)
21-24: LGTM: Good initialization pattern for early logging.The approach of initializing a logger with default config before service configuration is loaded ensures logging is available from the very start of the application lifecycle.
43-61: No buffering detected in logger—reinitialization is safeA search for any internal buffering or queuing mechanisms in our logger implementation returned no matches (only the Sentry logger’s shutdown‐only
flushinflow-core/src/utils/logger/sentry-logger.ts). This means:
- There is no in-memory buffer or queue in
getComponentLoggerthat would drop messages when you reset the global config.- The Sentry transport’s
flushis only for shutdown and isn’t involved in mid-runtime reinitialization.No changes needed—pending log entries won’t be lost during reinitialization.
93-97: Async usage verified; top‐level await is valid in DenoThe URL construction sits in a module-level (top-level) context where
awaitis permitted, and you already callawait createServiceConfig()—which initializessingletonServiceConfigAccessor—before building theserversarray. No further changes needed here.Likely an incorrect or invalid review comment.
flow-service/tests/integration/meshes-routes.integration.test.ts (2)
8-22: LGTM: Well-structured dynamic configuration setup.The setup test properly initializes service configuration and constructs the base URL dynamically. The error handling and validation logic is appropriate.
25-27: Good defensive programming with initialization guard.The guard ensures baseUrl is initialized before use, preventing potential test failures due to initialization order issues.
flow-core/src/utils/logger/component-logger.ts (2)
7-8: Consider thread safety for global state.The global variables could potentially have race conditions if multiple modules try to initialize simultaneously. Consider if Deno's single-threaded nature makes this safe or if additional synchronization is needed.
32-38: Verify fallback logging configuration is appropriate.The default console-only configuration with 'info' level seems reasonable for fallback, but ensure this aligns with operational requirements when service config fails to load.
flow-core/src/utils/logger/index.ts (2)
10-18: LGTM: Well-organized type exports.The reorganized exports clearly separate the new structured logging types from the legacy ones, making the API cleaner and more discoverable.
84-98: Structured channel configuration correctly implementedI’ve verified that:
createLogger(config?: LoggingConfig, baseContext?: LogContext)instructured-logger.tsaccepts the newLoggingConfig.- The
LoggingConfiginterface (inlogger-types.ts) includesconsoleChannel?,fileChannel?, andsentryChannel?fields.- There are no remaining boolean-flag references (e.g.
enableConsole,enableFile,enableSentry).The downstream logger properly handles the new structured channels—no further changes needed.
flow-core/src/utils/logger/logger-types.ts (4)
76-79: LGTM: Good addition for SPARQL operation context.The sparqlContext addition to LogContext provides appropriate structured context for SPARQL operations, enhancing debugging capabilities.
166-175: LGTM: Well-designed base configuration interface.The LogChannelConfig provides a clean foundation for channel-specific configurations with appropriate ontology alignment through property naming.
215-232: Excellent structured logging configuration design.The LoggingConfig interface provides comprehensive, channel-based configuration that aligns well with modern logging best practices and ontology requirements.
156-156: LogLevel string literal union is consistent across the codebaseNo remaining references to the old
LogLevelenum (e.g.LogLevel.*) or any numeric log‐level comparisons were found. The switch from an enum to a string-literal union forLogLevelhas been applied cleanly and consistently.


@CodeRabbit
Summary by CodeRabbit
New Features
Improvements
Refactor
Bug Fixes
Tests
Documentation
Chores