Skip to content

Commit 4ff2e87

Browse files
fix: Add F1_ prefix to over-scoped LOG_LEVEL, LOG_FORMAT environment variables
The change needed for back-compatibility with previous versions when LOG_LEVEL and LOG_FORMAT were not used to control f1 outputs. As these are quite common env variable names, they are currently over-scoped. F1 users might want to use custom loggers within their own scenarios that rely on such environment variables and configure them differently than f1 runner itself. LOG_FILE_PATH variable stays the same for back-compatibility.
1 parent 85f7b2c commit 4ff2e87

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ It provides the following information:
9595
| `PROMETHEUS_NAMESPACE` | string | `""` | Sets the metric label `namespace` to the specified value. Label is omitted if the value provided is empty.|
9696
| `PROMETHEUS_LABEL_ID` | string | `""` | Sets the metric label `id` to the specified value. Label is omitted if the value provided is empty.|
9797
| `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. |
98-
| `LOG_LEVEL` | string | `"info"`| Specify the log level of the default logger, one of: `debug`, `warn`, `error` |
99-
| `LOG_FORMAT` | string | `""`| Specify the log format of the default logger, defaults to `text` formatter, allows `json` |
98+
| `F1_LOG_LEVEL` | string | `"info"`| Specify the log level of the default logger, one of: `debug`, `warn`, `error` |
99+
| `F1_LOG_FORMAT` | string | `""`| Specify the log format of the default logger, defaults to `text` formatter, allows `json` |
100100

101101
## Contributions
102102
If you'd like to help improve `f1`, please fork this repo and raise a PR!

internal/envsettings/env.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const (
1212
EnvPrometheusPushGateway = "PROMETHEUS_PUSH_GATEWAY"
1313

1414
EnvLogFilePath = "LOG_FILE_PATH"
15-
EnvLogFormat = "LOG_FORMAT"
16-
EnvLogLevel = "LOG_LEVEL"
15+
EnvLogFormat = "F1_LOG_FORMAT"
16+
EnvLogLevel = "F1_LOG_LEVEL"
1717

1818
EnvFluentdHost = "FLUENTD_HOST"
1919
EnvFluentdPort = "FLUENTD_PORT"

pkg/f1/f1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func New() *F1 {
4747

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

0 commit comments

Comments
 (0)