Skip to content

Commit

Permalink
feat: add option to disable configuration logs
Browse files Browse the repository at this point in the history
  • Loading branch information
torives committed Mar 13, 2024
1 parent d808814 commit 8aa1f7a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ Address of the InputBox contract.

* **Type:** `string`

## `CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG`

Disables all log entries related to the node's configuration

* **Type:** `bool`
* **Default:** `"false"`

## `CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG`

When enabled, prints server-manager output to stdout and stderr directly.
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func read(name string, redact bool) (string, bool) {
if s, ok := cache.values[name]; ok {
return s, true
} else if s, ok := os.LookupEnv(name); ok {
if !redact {
if !redact && !GetCartesiExperimentalDisableConfigLog() {
configLogger.Printf("read %s environment variable: %v", name, s)
}
cache.values[name] = s
Expand Down
8 changes: 7 additions & 1 deletion internal/config/generate/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,10 @@ default = "false"
go-type = "bool"
description = """
When enabled, prints server-manager output to stdout and stderr directly.
All other log configurations are ignored."""
All other log configurations are ignored."""

[experimental.CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG]
default = "false"
go-type = "bool"
description = """
Disables all log entries related to the node's configuration"""
5 changes: 5 additions & 0 deletions internal/config/get.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8aa1f7a

Please sign in to comment.