Skip to content

log: add Llevel flag and OutputL() function #49239

Closed
@ccpaging

Description

@ccpaging

Some code I am working with take level string:

  • Add flag : Llevel
  • Add function OutputL:
    OutputL(calldepth int, level, s string) error
    outputl(calldepth int, level, s string) error

I have worked on log4go and nxlog4go for few years. The 3rd log alway face three problem:

  1. The interface function. More in stdlog, more need to be modified.
  2. Override Output function and replace with 3rd formatter.
  3. Building and using own Writer easy.

After compare few solutions, I found:

The level type should be string. It is better than int.
Do not implement too much interface functions in std log. Let the 3rd log do it.
Do not implement level filter in std log. Let the 3rd log do it.

New OutputL function receives the level string and writes it to the beginning of the log line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions