mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03: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,
|
||||
message?: log.LogMessage | undefined
|
||||
) => {
|
||||
switch (message?.level) {
|
||||
case "error":
|
||||
return path.join(logsPath, "error.txt");
|
||||
case "info":
|
||||
return path.join(logsPath, "info.txt");
|
||||
default:
|
||||
return path.join(logsPath, "logs.txt");
|
||||
if (message?.level === "error") {
|
||||
return path.join(logsPath, "error.txt");
|
||||
}
|
||||
|
||||
if (message?.level === "info") {
|
||||
return path.join(logsPath, "info.txt");
|
||||
}
|
||||
|
||||
return path.join(logsPath, "logs.txt");
|
||||
};
|
||||
|
||||
log.errorHandler.startCatching({
|
||||
|
|
Loading…
Reference in a new issue