ETNA-773: Adding ConsoleLogger
#46
Conversation
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
- Coverage 90.48% 86.22% -4.27%
==========================================
Files 45 48 +3
Lines 1976 2127 +151
==========================================
+ Hits 1788 1834 +46
- Misses 188 293 +105
Continue to review full report at Codecov.
|
etna/loggers/base.py
Outdated
from etna.core.mixins import BaseMixin | ||
|
||
|
||
class Logger(ABC, BaseMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Logger
-> BaseLogger
(AbstractLogger
)?
To explicit point that it is abstract class
# Conflicts: # tests/test_datasets/test_dataset.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some models left without wrapper -- nn models, for example
etna/loggers/base.py
Outdated
pass | ||
|
||
|
||
class LoggerComposite(BaseLogger): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make private _Logger.
etna/loggers/base.py
Outdated
class LoggerComposite(BaseLogger): | ||
"""Composite for loggers.""" | ||
|
||
def __init__(self, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need such difficult init now, because we initialize it once.
etna/loggers/console_logger.py
Outdated
from typing import Union | ||
|
||
import pandas as pd | ||
from loguru import logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets import as _logger
etna/loggers/console_logger.py
Outdated
super().__init__() | ||
if 0 in logger._core.handlers: | ||
logger.remove(0) | ||
logger.add(sink=sys.stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make:
self.logger = _logger.opt(depth=1, lazy=True, colors=True)
(lets try at least -- may be some problems with pickling will arise)
etna/loggers/base.py
Outdated
""" | ||
pass | ||
|
||
def set_config(self, forecaster): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add
ConsoleLogger
.