Rev | Line | |
---|
[204] | 1 | from abc import ABC, abstractmethod
|
---|
[949] | 2 | import logging
|
---|
[204] | 3 |
|
---|
| 4 | class Reporter(ABC):
|
---|
| 5 | '''
|
---|
| 6 | logs events. We don't use {@link Logger} because that's not an interface and
|
---|
| 7 | is hard to stub properly because the class is protected and builds on static
|
---|
| 8 | code.
|
---|
| 9 | '''
|
---|
[949] | 10 |
|
---|
| 11 | def __init__(self):
|
---|
| 12 | logging.basicConfig(level=logging.INFO)
|
---|
[204] | 13 |
|
---|
[949] | 14 |
|
---|
[204] | 15 | @abstractmethod
|
---|
| 16 | def log(self, level:int, msg:str, thrown:BaseException=None):
|
---|
| 17 | '''
|
---|
| 18 | Log a message, with associated Throwable information.
|
---|
| 19 |
|
---|
| 20 | @param level One of the message level identifiers. Eg
|
---|
| 21 | logging.WARNING
|
---|
| 22 | @param msg The string message (or a key in the message catalog)
|
---|
| 23 | @param thrown Exception associated with log message.
|
---|
| 24 | '''
|
---|
| 25 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.