write a MozLog package to unify logging

RESOLVED FIXED

Status

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: k0scist, Assigned: ahal)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mozbase])

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
https://wiki.mozilla.org/Auto-tools/Projects/MozBase#Logging_MozLog_Package

Right now, each harness implements its own logging to conform to a kinda non-specified log format: https://developer.mozilla.org/en/Test_log_format

Instead there should be one python package and perhaps one JS module to log appropriately.  This way new harnesses could make use of this and refinement of the logger would help all harnesses.

see also bug 622395
(Assignee)

Comment 1

7 years ago
For my responsiveness testing harness I'll need to write my logs JS side since that is the only way to communicate back the results to python without doing something crazy like using jsbridge. 

So I'd be happy to work on a JS side module.
(Assignee)

Comment 3

7 years ago
Created attachment 564267 [details]
Ver 1.0 - mozlog

This module wraps python's logging module and adds some basic functionality to allow you to log test specific messages (pass/fail etc.) as well as makes it easier to initialize a logger.

Let me know if you have any feedback or things you'd like to see added to this module.

This code can be used like this:
import mozlog
logger = mozlog.getLogger('MYAPP') # logs to stdout if no file passed in
logger.setLevel(mozlog.DEBUG)
logger.info('foo')
logger.testPass('bar')
mozlog.shutdown()
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Attachment #564267 - Flags: feedback?
(Reporter)

Comment 4

7 years ago
Comment on attachment 564267 [details]
Ver 1.0 - mozlog

Changing the damn mimetype so I can actually view it :(
Attachment #564267 - Attachment mime type: text/x-python → text/plain
(Reporter)

Comment 5

7 years ago
Comment on attachment 564267 [details]
Ver 1.0 - mozlog

I would probably structure this differently, but its fine for a first pass
(Assignee)

Comment 6

7 years ago
This got committed to https://github.com/mozilla/mozbase/tree/master/mozlog

Further issues / enhancements should be filed in new bugs under Testing/Mozbase
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Assignee)

Updated

7 years ago
Attachment #564267 - Flags: feedback?
You need to log in before you can comment on or make changes to this bug.