mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-15 04:30:12 +00:00
Keep Commonlib CLI diagnostics behind debug mode
This commit is contained in:
1 parent
a0f1483891
commit
e7124eda98
4 files changed
+28
-24
No files matched your search
@@ -378,10 +378,15 @@ export async function main(
|
||||
const writeLine = avoidStdoutNoise ? writeStderrLine : writeStdoutLine;
|
||||
writeLine(standardIo, ...values);
|
||||
};
|
||||
setGlobalLogFunction((msg, level) => {
|
||||
if (!options.debug && level !== LOG_LEVEL_NOTICE && level !== LOG_LEVEL_URGENT) return;
|
||||
writeStderrLine(standardIo, `[${level}]`, msg);
|
||||
});
|
||||
if (options.debug) {
|
||||
setGlobalLogFunction((msg, level) => {
|
||||
writeStderrLine(standardIo, `[${level}]`, msg);
|
||||
});
|
||||
} else {
|
||||
setGlobalLogFunction((msg, level) => {
|
||||
// NO OP, leave it to logFunction
|
||||
});
|
||||
}
|
||||
if (options.command === "init-settings") {
|
||||
await createDefaultSettingsFile(options, standardIo);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user