Skip to content

Logger level INFO should stream to stdout, not stderr #72

@c-dilks

Description

@c-dilks

Test:

// test_reader.groovy

import org.jlab.io.hipo.HipoDataSource

def inHipo = args[0]

def reader = new HipoDataSource()
reader.open(inHipo)
reader.close()

Run with:

run-groovy test_reader.groovy example_hipo_file.hipo >log.stdout 2>log.stderr

Expected result:

log.stderr should be empty, indicating no errors (nothing streamed to stderr)

Actual result:

log.stderr contains

[DataSourceDump] --> opened file with events #

which appears to originate from

LOGGER.log(Level.INFO,"[DataSourceDump] --> opened file with events # " );

This is an INFO level printout, and it would be preferable not to have it streamed to stderr (especially for the case of running batch jobs, where parsing multiple error logs is essential).

Feature request:

  • send INFO to stdout and send WARNING and SEVERE to stderr; this may not be easy but something like https://stackoverflow.com/a/23717493 may be related.
  • aside: there are some cases of System.out.println("ERROR: ..."); which should either be changed to System.err.println or use an appropriate Logger level

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