Skip to content

Commit

Permalink
fix: urgent fix that breaks logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jan 9, 2024
1 parent 25b55d9 commit 3b58a38
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export function logs(args: LogsParameters, ...messages: unknown[]) {
}

export function monkeyPatchConsole(plugin: GithubPublisher) {

if (!plugin.settings.plugin.dev) {
const stack = new Error().stack?.split("\n")?.[3];
if (!stack?.includes("obsidian-mkdocs-publisher") || !plugin.settings.plugin.dev) {
return;
}

Expand All @@ -96,12 +96,6 @@ export function monkeyPatchConsole(plugin: GithubPublisher) {
warn: console.warn,
};
const logMessages = (prefix: string) => (...messages: unknown[]) => {
//search each plugin to find the one who call the console
//if it's not this plugin, do nothing
const stack = new Error().stack?.split("\n")?.[3];
if (!stack?.includes("obsidian-mkdocs-publisher")) {
return;
}
logs.push(`\n[${prefix}]`);
for (const message of messages) {
logs.push(String(message));
Expand Down

0 comments on commit 3b58a38

Please sign in to comment.