Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion docs/getting-started.mdx.vel
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Messages from every provider merge into the single `app.messages` stream. The `m

## Logging

Spectrum emits structured logs across the core runtime and providers. Control the verbosity with `logLevel`:
Spectrum emits structured logs across the core runtime and providers. The default log level is `info`. Control the verbosity with `logLevel`:

```ts
const app = await Spectrum({
Expand All @@ -186,6 +186,8 @@ const app = await Spectrum({
});
```

An explicit `logLevel` takes precedence over the `LOG_LEVEL` environment variable.

Log output is sanitized — sensitive fields like tokens and secrets are redacted from error attributes before they reach any log destination.

## Telemetry
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"examples/*"
],
"dependencies": {
"@photon-ai/otel": "^3.1.0"
"@photon-ai/otel": "^3.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@photon-ai/otel": "^3.1.0",
"@photon-ai/otel": "^3.3.0",
"@photon-ai/proto": "^0.2.4",
"@repeaterjs/repeater": "^3.0.6",
"marked": "^18.0.5",
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/spectrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ export interface SpectrumOptions {

/**
* Minimum severity emitted by the SDK's structured logger (to both the
* console and, when telemetry is on, OTLP). Applies process-wide. The
* `LOG_LEVEL` environment variable still takes precedence.
* console and, when telemetry is on, OTLP). Applies process-wide and takes
* precedence over the `LOG_LEVEL` environment variable when provided.
*
* @default "debug" in development, "info" otherwise (via `DEPLOYMENT_ENV`)
* @default "info"
*/
logLevel?: LogLevel;
}
Expand Down Expand Up @@ -303,8 +303,8 @@ export async function Spectrum<
} = options;
const flattenGroups = runtimeOptions?.flattenGroups ?? false;
// Honor an explicit log-level override before anything logs. Applies even
// when telemetry is off (the console logger respects it too); the LOG_LEVEL
// env var still wins inside @photon-ai/otel.
// when telemetry is off (the console logger respects it too) and takes
// precedence over LOG_LEVEL inside @photon-ai/otel.
applyLogLevel(runtimeOptions?.logLevel);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is accurate for the new otel contract, but the behavior change itself is not implemented here — it comes from the @photon-ai/otel ^3.3.0 bump. Worth keeping the docs/comments in sync (as this PR does), and maybe noting in the PR summary that Spectrum is adopting otel#15 rather than re-encoding the policy locally.

// The per-webhook signing secret for native Spectrum webhooks. Explicit option
// wins; otherwise fall back to the env var so deployments can inject it.
Expand Down
2 changes: 1 addition & 1 deletion packages/imessage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@grpc/grpc-js": "^1.14.4",
"@photon-ai/advanced-imessage": "^2.0.2",
"@photon-ai/otel": "^3.1.0",
"@photon-ai/otel": "^3.3.0",
"lru-cache": "^11.0.0",
"marked": "^18.0.5",
"nice-grpc": "^2.1.16",
Expand Down
Loading