mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 12:10:44 +00:00
test: avoid channel catalog import in logger setup
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { Chalk } from "chalk";
|
||||
import type { Logger as TsLogger } from "tslog";
|
||||
import { normalizeChatChannelId } from "../channels/ids.js";
|
||||
import { isVerbose } from "../global-state.js";
|
||||
import { defaultRuntime, type OutputRuntimeEnv, type RuntimeEnv } from "../runtime.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
@@ -114,13 +113,41 @@ const SUBSYSTEM_COLOR_OVERRIDES: Record<string, (typeof SUBSYSTEM_COLORS)[number
|
||||
};
|
||||
const SUBSYSTEM_PREFIXES_TO_DROP = ["gateway", "channels", "providers"] as const;
|
||||
const SUBSYSTEM_MAX_SEGMENTS = 2;
|
||||
const CHANNEL_SUBSYSTEM_PREFIXES = new Set([
|
||||
"clickclack",
|
||||
"discord",
|
||||
"feishu",
|
||||
"googlechat",
|
||||
"imessage",
|
||||
"irc",
|
||||
"line",
|
||||
"matrix",
|
||||
"mattermost",
|
||||
"msteams",
|
||||
"nextcloud-talk",
|
||||
"nostr",
|
||||
"openclaw-weixin",
|
||||
"qqbot",
|
||||
"signal",
|
||||
"slack",
|
||||
"synology-chat",
|
||||
"telegram",
|
||||
"tlon",
|
||||
"twitch",
|
||||
"webchat",
|
||||
"wecom",
|
||||
"whatsapp",
|
||||
"yuanbao",
|
||||
"zalo",
|
||||
"zalouser",
|
||||
]);
|
||||
|
||||
function isChannelSubsystemPrefix(value: string): boolean {
|
||||
const normalized = normalizeLowercaseStringOrEmpty(value);
|
||||
if (!normalized) {
|
||||
return false;
|
||||
}
|
||||
return normalizeChatChannelId(normalized) === normalized || normalized === "webchat";
|
||||
return CHANNEL_SUBSYSTEM_PREFIXES.has(normalized);
|
||||
}
|
||||
|
||||
function pickSubsystemColor(color: ChalkInstance, subsystem: string): ChalkInstance {
|
||||
|
||||
Reference in New Issue
Block a user