Closed Bug 1497871 Opened 7 years ago Closed 7 years ago

Mozversion - display version information only when logging level is DEBUG

Categories

(Testing :: Mozbase, enhancement, P3)

Version 3
enhancement

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: schecherita, Assigned: gbrown, Mentored)

Details

(Keywords: good-first-bug)

We are using mozversion in Iris to retrieve Firefox version information Every time we are calling get_version(), all version information is displayed in the console. Can this behavior be changed? For example to display version information only when the logging level is DEBUG?
Instead of changing the logging level to debug, I would suggest that it's only useful to log this information when mozversion is being used as a command-line tool. Perhaps a compromise would be to set the level to debug when mozversion is not being invoked from the command line.
Mentor: dave.hunt
Keywords: good-first-bug
I am reluctant to change the existing logging behavior: It seems reasonable and other callers may be relying on it. There are work-arounds: If running as a command-line tool, the output can be redirected: python mozversion.py > /dev/null If running as a command-line tool, output can be redirected via logging parameters: python mozversion.py --log-mach=myfile Otherwise, if calling get_version(), the "mozversion" logger can be manipulated: mozlog.commandline.setup_logging('mozversion', None, {}) get_version(...) Good enough?
Flags: needinfo?(schecherita)
I'd be surprised if anything is relying on the logging of version details rather than the response from the call to `get_version`. I'd be more concerned about silencing the logging entirely and potentially missing warning and more critical level logging.
Thanks Geoff for your reply. Your solution to manipulate the "mozversion" logger is exactly what I need.
Assignee: nobody → gbrown
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(schecherita)
Priority: -- → P3
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.