@opencode-ai/util 0.0.0-dev-18089 → 0.0.0-dev-18093
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,5 +2,5 @@ import { Effect, FileSystem, Logger } from "effect";
|
|
|
2
2
|
export declare function file(local?: boolean, channel?: string): string;
|
|
3
3
|
export declare function fileLogger(target?: string, id?: string): Effect.Effect<Logger.Logger<unknown, void>, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Scope").Scope>;
|
|
4
4
|
export declare function minimumLogLevel(): "Error" | "Warn" | "Info" | "Debug";
|
|
5
|
-
export declare function loggers(local?: boolean, channel?: string): (Effect.Effect<Logger.Logger<unknown, void>, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Scope").Scope>
|
|
5
|
+
export declare function loggers(local?: boolean, channel?: string): (Logger.Logger<unknown, void> | Effect.Effect<Logger.Logger<unknown, void>, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Scope").Scope>)[];
|
|
6
6
|
export * as Logging from "./logging.js";
|
|
@@ -53,7 +53,11 @@ export function fileLogger(target = file(), id = runID()) {
|
|
|
53
53
|
return yield* Logger.toFile(formatter(id), target, { flag: "a" });
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
const stderrLogger = Logger.make((options) =>
|
|
56
|
+
const stderrLogger = Logger.make((options) => {
|
|
57
|
+
if (process.env.OPENCODE_PRINT_LOGS !== "1")
|
|
58
|
+
return;
|
|
59
|
+
process.stderr.write(formatter().log(options) + "\n");
|
|
60
|
+
});
|
|
57
61
|
export function minimumLogLevel() {
|
|
58
62
|
const value = process.env.OPENCODE_LOG_LEVEL?.toUpperCase();
|
|
59
63
|
const levels = {
|
|
@@ -65,7 +69,6 @@ export function minimumLogLevel() {
|
|
|
65
69
|
return value && value in levels ? levels[value] : levels.INFO;
|
|
66
70
|
}
|
|
67
71
|
export function loggers(local = true, channel = "local") {
|
|
68
|
-
|
|
69
|
-
return process.env.OPENCODE_PRINT_LOGS === "1" ? [logger, stderrLogger] : [logger];
|
|
72
|
+
return [fileLogger(file(local, channel)), stderrLogger];
|
|
70
73
|
}
|
|
71
74
|
export * as Logging from "./logging.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/util",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-18093",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"default": "./dist/global-roots.js"
|
|
32
32
|
},
|
|
33
33
|
"#runtime-import": {
|
|
34
|
-
"workerd": "./dist/runtime/import.
|
|
34
|
+
"workerd": "./dist/runtime/import.workerd.js",
|
|
35
35
|
"bun": "./dist/runtime/import.bun.js",
|
|
36
36
|
"node": "./dist/runtime/import.node.js",
|
|
37
37
|
"default": "./dist/runtime/import.bun.js"
|