Skip to content

Commit 1997b4e

Browse files
authored
fix: bin test log level config (#546)
1 parent f5123bf commit 1997b4e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bindings/utils/testBindingBinary.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {createRequire} from "module";
44
import path from "path";
55
import {getConsoleLogPrefix} from "../../utils/getConsoleLogPrefix.js";
66
import {runningInBun, runningInElectron} from "../../utils/runtime.js";
7-
import {BuildGpu, LlamaLogLevel} from "../types.js";
7+
import {BuildGpu} from "../types.js";
88
import {LlamaLogLevelToAddonLogLevel} from "../Llama.js";
9-
import {newGithubIssueUrl} from "../../config.js";
9+
import {defaultBindingTestLogLevel, newGithubIssueUrl} from "../../config.js";
1010
import {getPlatform} from "./getPlatform.js";
1111
import type {BindingModule} from "../AddonTypes.js";
1212

@@ -274,7 +274,7 @@ if (process.env.TEST_BINDING_CP === "true" && (process.parentPort != null || pro
274274
try {
275275
binding = require(message.bindingBinaryPath);
276276

277-
const errorLogLevel = LlamaLogLevelToAddonLogLevel.get(LlamaLogLevel.error);
277+
const errorLogLevel = LlamaLogLevelToAddonLogLevel.get(defaultBindingTestLogLevel);
278278
if (errorLogLevel != null)
279279
binding.setLoggerLogLevel(errorLogLevel);
280280

src/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export const defaultLlamaCppDebugMode = env.get("NODE_LLAMA_CPP_DEBUG")
7373
export const defaultSkipDownload = env.get("NODE_LLAMA_CPP_SKIP_DOWNLOAD")
7474
.default("false")
7575
.asBool();
76+
export const defaultBindingTestLogLevel = env.get("NODE_LLAMA_CPP_BINDING_TEST_LOG_LEVEL")
77+
.default(LlamaLogLevel.error)
78+
.asEnum(LlamaLogLevelValues);
7679
export const defaultXpacksStoreDirectory = env.get("NODE_LLAMA_CPP_XPACKS_STORE_FOLDER")
7780
.default(localXpacksStoreDirectory)
7881
.asString();

0 commit comments

Comments
 (0)