ax(logging): replace prose comment on New with usage example
AX Principle 2: comments must show concrete usage, not restate the function name. "New creates a new Logger with the given configuration" restated the signature — replaced with a callable example. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
0f2c25f7ef
commit
7d6d00a0e6
1 changed files with 2 additions and 1 deletions
|
|
@ -64,7 +64,8 @@ func DefaultConfig() Config {
|
|||
}
|
||||
}
|
||||
|
||||
// New creates a new Logger with the given configuration.
|
||||
// New creates a Logger with the given configuration.
|
||||
// logger := logging.New(logging.Config{Output: os.Stderr, Level: logging.LevelInfo, Component: "mining"})
|
||||
func New(cfg Config) *Logger {
|
||||
if cfg.Output == nil {
|
||||
cfg.Output = os.Stderr
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue