Skip to content

PrefixPrinter does not use changed defaultWriter #751

@christeredvartsen

Description

@christeredvartsen

The prefix printers included in pterm are initialized to use pterm.defaultWriter as their writer.

When calling pterm.SetDefaultOutput(writer) the prefix printers will still use the original default, so we need to call p.WithWriter(writer) to use a different writer.

Reading the comment of the pterm.SetDefaultOutput function I would assume the prefix printers would also use the updated default.

I have a fix for this in a local branch along with a test case, and can send a pull request if you are interested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions