mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
@@ -125,7 +125,8 @@ func run(ctx context.Context, args []string) int {
|
||||
// Initialize collectors before loading and parsing CLI arguments
|
||||
collectors := collector.NewWithFlags(app)
|
||||
|
||||
if err := config.Parse(app, os.Args[1:]); err != nil {
|
||||
//nolint:contextcheck
|
||||
if err := config.Parse(app, args); err != nil {
|
||||
//nolint:sloglint // we do not have an logger yet
|
||||
slog.LogAttrs(ctx, slog.LevelError, "Failed to load configuration",
|
||||
slog.Any("err", err),
|
||||
@@ -135,11 +136,13 @@ func run(ctx context.Context, args []string) int {
|
||||
}
|
||||
|
||||
debug.SetMemoryLimit(*memoryLimit)
|
||||
|
||||
logger, err := log.New(logConfig)
|
||||
if err != nil {
|
||||
logger.LogAttrs(ctx, slog.LevelError, "failed to create logger",
|
||||
slog.Any("err", err),
|
||||
)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user