Skip to content

Allow output of measurement data to stdout again #16

@UsualSpec

Description

@UsualSpec

84c59ab introduced the -O flag which allows writing all output to a file. Now all output goes to stderr by default.
I believe that measurement outputs are not errors and should therefore - like before - still go to stdout (if the -O flag is not set).

In our project, we get data from stdout of pinpoint (ref: https://github.com/nsg-ethz/autopower/blob/cdb4c9212433088ddd614a17a9a198c33e689427/client/client.cc#L201) and reverted some changes as quick fix:
nsg-ethz@23d1aea nsg-ethz@dc8cefa

This is not ideal as it diverges from upstream, and I'd like to propose some changes to output handling:

As easy fix: allow passing stdout to the -O flag to print to stdout instead of stderr. This will then disallow writing to a file called stdout - but this can be documented.

As more involved, but potentially cleaner fix: to introduce an error output stream which - if -O is set - writes to the file together with the output_stream, else just goes to stderr, while output_stream goes to stdout.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions