Skip to content

Commit

Permalink
clients/nimbus-el: improve logging config
Browse files Browse the repository at this point in the history
This makes the log level configurable and also disables colored logging
at compile time.
  • Loading branch information
fjl committed Jun 16, 2023
1 parent dd1627f commit 3306899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/nimbus-el/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ WORKDIR /nimbus-eth1

RUN NPROC=$(nproc); make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 update

RUN NPROC=$(nproc); make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" nimbus && \
RUN NPROC=$(nproc); make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:chronicles_colors=none" nimbus && \
mv build/nimbus /usr/bin/

# --------------------------------- #
Expand Down
12 changes: 9 additions & 3 deletions clients/nimbus-el/nimbus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ set -e
nimbus=/usr/bin/nimbus
FLAGS="--prune-mode:archive --nat:extip:0.0.0.0"

if [ "$HIVE_LOGLEVEL" != "" ]; then
FLAGS="$FLAGS --log-level:DEBUG"
fi
loglevel=DEBUG
case "$HIVE_LOGLEVEL" in
0|1) loglevel=ERROR ;;
2) loglevel=WARN ;;
3) loglevel=INFO ;;
4) loglevel=DEBUG ;;
5) loglevel=TRACE ;;
esac
FLAGS="$FLAGS --log-level:$loglevel"

# It doesn't make sense to dial out, use only a pre-set bootnode.
if [ "$HIVE_BOOTNODE" != "" ]; then
Expand Down

0 comments on commit 3306899

Please sign in to comment.