Skip to content

Commit

Permalink
Add log level setting for ogmios (#1736)
Browse files Browse the repository at this point in the history
## Description
Adds the ability to launch Ogmios with a set log level.
  • Loading branch information
Scitz0 authored Feb 29, 2024
1 parent 1b51c28 commit 656bcfe
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/cnode-helper-scripts/ogmios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#OGMIOSBIN="${HOME}"/.local/bin/ogmios # Path for ogmios binary, if not in $PATH
#HOSTADDR=127.0.0.1 # Default Listen IP/Hostname for Ogmios Server
#HOSTPORT=1337 # Default Listen port for Ogmios Server
#LOG_LEVEL=Notice # Debug | Info | Notice | Warning | Error | Off

######################################
# Do NOT modify code below #
Expand All @@ -37,6 +38,18 @@ set_defaults() {
[[ -z "${OGMIOSBIN}" ]] && OGMIOSBIN="${HOME}"/.local/bin/ogmios
[[ -z "${HOSTADDR}" ]] && HOSTADDR=127.0.0.1
[[ -z "${HOSTPORT}" ]] && HOSTPORT=1337
if [[ -z "${LOG_LEVEL}" ]]; then
LOG_LEVEL=Notice
else
case ${LOG_LEVEL} in
Debug) : ;;
Info) : ;;
Warning) : ;;
Error) : ;;
Off) : ;;
*) LOG_LEVEL=Notice ;;
esac
fi
}

pre_startup_sanity() {
Expand Down Expand Up @@ -108,4 +121,4 @@ fi
pre_startup_sanity

# Run Ogmios Server
"${OGMIOSBIN}" --node-config "${CONFIG}" --node-socket "${CARDANO_NODE_SOCKET_PATH}" --host ${HOSTADDR} --port ${HOSTPORT} >> "${LOG_DIR}"/ogmios.log 2>&1
"${OGMIOSBIN}" --node-config "${CONFIG}" --node-socket "${CARDANO_NODE_SOCKET_PATH}" --host ${HOSTADDR} --port ${HOSTPORT} --log-level ${LOG_LEVEL} >> "${LOG_DIR}"/ogmios.log 2>&1

0 comments on commit 656bcfe

Please sign in to comment.