Skip to content

refactor: generalize/enhance logging facilities #110

@water-sucks

Description

@water-sucks

Feature Description

The logger right now is pretty barebones, and doesn't support different sources and toggling verbosity levels for debug logging, stuff like that.

For example, many places are littered with if opts.Verbose or some variant of that everywhere. that's not good, and should be configured by verbosity flags. for example, CmdArray() output should be only reserved for at least verbosity level 1 (aka -v specified on the command line at least once).

There are a few things I would like to do to enhance the Logger facility:

  • Turn the current Logger into an interface and split off the concrete implementation into a ConsoleLogger or something similar
  • Add support for specifying verbosity levels
  • Add debug logging wherever necessary
  • Add alternative sinks (i.e. a SyslogLogger for nixos activate)

These will make the logger more pleasant to use.

Help

Yes

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions