Skip to content

Commit

Permalink
fix(settings): It's not possible to switch the log level
Browse files Browse the repository at this point in the history
Previously it was not possible to change the state of the Debug toggle.
This is because the code forced the setting the default value, ignoring
the database setup, hence always setting the DEBUG as LogLevel.

Closes #13139
  • Loading branch information
kounkou committed Jan 25, 2024
1 parent 654da3e commit c122456
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
6 changes: 0 additions & 6 deletions src/app_service/service/accounts/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ QtObject:
"wallet-root-address": account.derivedAccounts.walletRoot.address,
"preview-privacy?": true,
"signing-phrase": generateSigningPhrase(3),
"log-level": main_constants.LOG_LEVEL,
"latest-derived-path": 0,
"currency": "usd",
"networks/networks": @[],
Expand Down Expand Up @@ -341,8 +340,6 @@ QtObject:
result["ClusterConfig"]["DiscV5BootstrapNodes"] = %* (@[])
result["Rendezvous"] = newJBool(false)

result["LogLevel"] = newJString(toStatusGoSupportedLogLevel(main_constants.LOG_LEVEL))

if STATUS_PORT != 0:
result["ListenAddr"] = newJString("0.0.0.0:" & $main_constants.STATUS_PORT)

Expand Down Expand Up @@ -405,8 +402,6 @@ QtObject:
"TorrentDir": DEFAULT_TORRENT_CONFIG_TORRENTDIR
}

result["LogLevel"] = newJString(toStatusGoSupportedLogLevel(main_constants.LOG_LEVEL))

if STATUS_PORT != 0:
result["ListenAddr"] = newJString("0.0.0.0:" & $main_constants.STATUS_PORT)

Expand Down Expand Up @@ -535,7 +530,6 @@ QtObject:
"wallet-root-address": walletRootAddress,
"preview-privacy?": true,
"signing-phrase": generateSigningPhrase(3),
"log-level": main_constants.LOG_LEVEL,
"latest-derived-path": 0,
"currency": "usd",
"networks/networks": @[],
Expand Down
1 change: 0 additions & 1 deletion src/constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ let
TORRENT_CONFIG_PORT* = desktopConfig.defaultTorentConfigPort
WAKU_V2_PORT* = desktopConfig.defaultWakuV2Port
STATUS_PORT* = desktopConfig.statusPort
LOG_LEVEL* = desktopConfig.logLevel

# build variables
POKT_TOKEN_RESOLVED* = desktopConfig.poktToken
Expand Down
7 changes: 0 additions & 7 deletions src/nim_status_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ proc prepareLogging() =
except:
logLoggingFailure(cstring(msg), getCurrentException())

let defaultLogLvl = if defined(production): chronicles.LogLevel.INFO else: chronicles.LogLevel.DEBUG
# default log level can be overriden by LOG_LEVEL env parameter
let logLvl = try: parseEnum[chronicles.LogLevel](main_constants.LOG_LEVEL)
except: defaultLogLvl

setLogLevel(logLvl)

let formattedDate = now().format("yyyyMMdd'_'HHmmss")
let logFile = fmt"app_{formattedDate}.log"
discard defaultChroniclesStream.outputs[1].open(LOGDIR & logFile, fmAppend)
Expand Down

0 comments on commit c122456

Please sign in to comment.