Skip to content

feat(logging): Consolidate logging flags #858

@erezrokah

Description

@erezrokah

Is your feature request related to a problem? Please describe.

We have 10 flags to configure logging:
verbose, enable-console-log, encode-json, enable-file-logging, disable-log-color, log-directory, log-file, max-size, max-backups, max-age

Some use enable-* notation, one uses disable-* notation, some prefix the flag with log-* and some don't have a prefix.
Also enable-file-logging use logging while others use log.

We should ensure flags have consistent naming and descriptions.

Describe the solution you'd like

Suggestions:

Describe alternatives you've considered

Move some of the options (like max-size, max-backups, max-age) to config.hcl, but that's tricky since then how do users will be able to control logging before they generate the config

Logging configuration can be set via the config.yml file but should be removed

Additional context

Related to https://github.com/cloudquery/cloudquery/issues?q=is%3Aopen+is%3Aissue+label%3A%22theme%3A+logging%22.

We could do this in a non breaking way via MarkDeprecated and SetNormalizeFunc functions of the Cobra API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions