chore(logging): strip redundant provider tags
This commit is contained in:
@@ -9,6 +9,12 @@ describe("stripRedundantSubsystemPrefixForConsole", () => {
|
||||
).toBe("hello");
|
||||
});
|
||||
|
||||
it("drops '<Subsystem>:' prefix case-insensitively", () => {
|
||||
expect(
|
||||
stripRedundantSubsystemPrefixForConsole("WhatsApp: hello", "whatsapp"),
|
||||
).toBe("hello");
|
||||
});
|
||||
|
||||
it("drops '<subsystem> ' prefix", () => {
|
||||
expect(
|
||||
stripRedundantSubsystemPrefixForConsole(
|
||||
@@ -18,6 +24,15 @@ describe("stripRedundantSubsystemPrefixForConsole", () => {
|
||||
).toBe("gateway: closed");
|
||||
});
|
||||
|
||||
it("drops '[subsystem]' prefix", () => {
|
||||
expect(
|
||||
stripRedundantSubsystemPrefixForConsole(
|
||||
"[discord] connection stalled",
|
||||
"discord",
|
||||
),
|
||||
).toBe("connection stalled");
|
||||
});
|
||||
|
||||
it("keeps messages that do not start with the subsystem", () => {
|
||||
expect(
|
||||
stripRedundantSubsystemPrefixForConsole("discordant: hello", "discord"),
|
||||
|
||||
Reference in New Issue
Block a user