diff --git a/src/bindings/utils/testBindingBinary.ts b/src/bindings/utils/testBindingBinary.ts index a3cd6326..4a40b12b 100644 --- a/src/bindings/utils/testBindingBinary.ts +++ b/src/bindings/utils/testBindingBinary.ts @@ -4,9 +4,9 @@ import {createRequire} from "module"; import path from "path"; import {getConsoleLogPrefix} from "../../utils/getConsoleLogPrefix.js"; import {runningInBun, runningInElectron} from "../../utils/runtime.js"; -import {BuildGpu, LlamaLogLevel} from "../types.js"; +import {BuildGpu} from "../types.js"; import {LlamaLogLevelToAddonLogLevel} from "../Llama.js"; -import {newGithubIssueUrl} from "../../config.js"; +import {defaultBindingTestLogLevel, newGithubIssueUrl} from "../../config.js"; import {getPlatform} from "./getPlatform.js"; import type {BindingModule} from "../AddonTypes.js"; @@ -274,7 +274,7 @@ if (process.env.TEST_BINDING_CP === "true" && (process.parentPort != null || pro try { binding = require(message.bindingBinaryPath); - const errorLogLevel = LlamaLogLevelToAddonLogLevel.get(LlamaLogLevel.error); + const errorLogLevel = LlamaLogLevelToAddonLogLevel.get(defaultBindingTestLogLevel); if (errorLogLevel != null) binding.setLoggerLogLevel(errorLogLevel); diff --git a/src/config.ts b/src/config.ts index cded8eb9..e9373902 100644 --- a/src/config.ts +++ b/src/config.ts @@ -73,6 +73,9 @@ export const defaultLlamaCppDebugMode = env.get("NODE_LLAMA_CPP_DEBUG") export const defaultSkipDownload = env.get("NODE_LLAMA_CPP_SKIP_DOWNLOAD") .default("false") .asBool(); +export const defaultBindingTestLogLevel = env.get("NODE_LLAMA_CPP_BINDING_TEST_LOG_LEVEL") + .default(LlamaLogLevel.error) + .asEnum(LlamaLogLevelValues); export const defaultXpacksStoreDirectory = env.get("NODE_LLAMA_CPP_XPACKS_STORE_FOLDER") .default(localXpacksStoreDirectory) .asString();