mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-15 04:32:13 +00:00
refactor switch case into ifs
This commit is contained in:
parent
bbb4b8d16b
commit
b16acd181d
1 changed files with 8 additions and 7 deletions
|
@ -10,14 +10,15 @@ log.transports.file.resolvePathFn = (
|
||||||
_: log.PathVariables,
|
_: log.PathVariables,
|
||||||
message?: log.LogMessage | undefined
|
message?: log.LogMessage | undefined
|
||||||
) => {
|
) => {
|
||||||
switch (message?.level) {
|
if (message?.level === "error") {
|
||||||
case "error":
|
return path.join(logsPath, "error.txt");
|
||||||
return path.join(logsPath, "error.txt");
|
|
||||||
case "info":
|
|
||||||
return path.join(logsPath, "info.txt");
|
|
||||||
default:
|
|
||||||
return path.join(logsPath, "logs.txt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message?.level === "info") {
|
||||||
|
return path.join(logsPath, "info.txt");
|
||||||
|
}
|
||||||
|
|
||||||
|
return path.join(logsPath, "logs.txt");
|
||||||
};
|
};
|
||||||
|
|
||||||
log.errorHandler.startCatching({
|
log.errorHandler.startCatching({
|
||||||
|
|
Loading…
Reference in a new issue