Skip to content

Proposal: use stderr for all log output, reserve stdout for machine readable output #2934

@tjenkinson

Description

@tjenkinson

What are peoples thoughts on switching to stderr for all log output?

Then we could only use stdout for outputting json from commands that choose to support a —json flag (or potentially other formats for machine parsing that make sense)

We could try and support things like —json in a way that means for those use cases stdout isn’t used, but that’s more complex and potentially more error prone than not using stdout at all.

I’m wondering if a change like this would be considered breaking or not? If the current output is only meant to be human readable and not parsed, then possibly not.

Asking because I’d like a —json flag for page publishing that outputs the url and I’m wondering what direction to go in. I hacked together an approach that switches the logger into an stderr only mode but if we could always use stderr it would become a lot simpler, hence this issue :)

refs #2927
refs #2437

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions