Skip to content

Commit

Permalink
Merge pull request #284 from dmitryabramov-f3/dabramov-fix-over-scope…
Browse files Browse the repository at this point in the history
…d-env-vars

fix: Add F1_ prefix to over-scoped LOG_LEVEL, LOG_FORMAT environment variables
  • Loading branch information
dmitryabramov-f3 authored Sep 10, 2024
2 parents 85f7b2c + 4ff2e87 commit f016ea2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ It provides the following information:
| `PROMETHEUS_NAMESPACE` | string | `""` | Sets the metric label `namespace` to the specified value. Label is omitted if the value provided is empty.|
| `PROMETHEUS_LABEL_ID` | string | `""` | Sets the metric label `id` to the specified value. Label is omitted if the value provided is empty.|
| `LOG_FILE_PATH` | string | `""`| Specify the log file path used if `--verbose` is disabled. The logfile path will be an automatically generated temp file if not specified. |
| `LOG_LEVEL` | string | `"info"`| Specify the log level of the default logger, one of: `debug`, `warn`, `error` |
| `LOG_FORMAT` | string | `""`| Specify the log format of the default logger, defaults to `text` formatter, allows `json` |
| `F1_LOG_LEVEL` | string | `"info"`| Specify the log level of the default logger, one of: `debug`, `warn`, `error` |
| `F1_LOG_FORMAT` | string | `""`| Specify the log format of the default logger, defaults to `text` formatter, allows `json` |

## Contributions
If you'd like to help improve `f1`, please fork this repo and raise a PR!
4 changes: 2 additions & 2 deletions internal/envsettings/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const (
EnvPrometheusPushGateway = "PROMETHEUS_PUSH_GATEWAY"

EnvLogFilePath = "LOG_FILE_PATH"
EnvLogFormat = "LOG_FORMAT"
EnvLogLevel = "LOG_LEVEL"
EnvLogFormat = "F1_LOG_FORMAT"
EnvLogLevel = "F1_LOG_LEVEL"

EnvFluentdHost = "FLUENTD_HOST"
EnvFluentdPort = "FLUENTD_PORT"
Expand Down
2 changes: 1 addition & 1 deletion pkg/f1/f1.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func New() *F1 {

// WithLogger allows specifying logger to be used for all internal and scenario logs
//
// This will disable the LOG_LEVEL and LOG_FORMAT options, as they only relate to the built-in
// This will disable the F1_LOG_LEVEL and F1_LOG_FORMAT options, as they only relate to the built-in
// logger.
//
// The logger will be used for non-interactive output, file logs or when `--verbose` is specified.
Expand Down

0 comments on commit f016ea2

Please sign in to comment.