validate-log-fields

command
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Command validate-log-fields scans a Go project for deprecated logging field names and reports offenses.

Exit codes:

0  No new offenses found (the codebase is clean, or all offenses are
   already tracked in the TODO file).
1  New offenses found that are not yet tracked in the TODO file.
2  Unexpected error (scan failure, unreadable TODO file, etc.).

Usage:

go run gitlab.com/gitlab-org/labkit/v2/cmd/validate-log-fields [flags] [dir]

Flags:

-todo string       Path to the TODO file (default ".labkit_logging_todo.yml")
-update-todo       Merge new offenses into the TODO file and exit 0

Examples:

# Check for new offenses in the current directory (CI-safe: exits 1 on new offenses)
go run gitlab.com/gitlab-org/labkit/v2/cmd/validate-log-fields .

# Persist new offenses for deferred remediation and exit 0
go run gitlab.com/gitlab-org/labkit/v2/cmd/validate-log-fields -update-todo .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL