Skip to content

Commit

Permalink
Use Rich for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Jun 16, 2020
1 parent 0459ba4 commit 874dc0e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ botocore==1.16.20
certifi==2020.4.5.1
cfgv==3.1.0
chardet==3.0.4
colorama==0.4.3
commonmark==0.9.1
coverage==5.1
decorator==4.4.2
distlib==0.3.0
Expand All @@ -26,13 +28,15 @@ Mastodon.py==1.5.1
mf2py==1.1.2
more-itertools==8.3.0
mutagen==1.44.0
-e git+git@github.com:betodealmeida/nefelibata.git@8e55ce6ee19a08c9783c0c75b65f21934da0399a#egg=nefelibata
-e git+git@github.com:betodealmeida/nefelibata.git@0459ba42e7bb99ac1dd555119cc7465e6237e57a#egg=nefelibata
nodeenv==1.3.5
packaging==20.4
pluggy==0.13.1
pprintpp==0.4.0
pre-commit==2.4.0
py==1.8.1
pyfakefs==4.0.2
Pygments==2.6.1
pyparsing==2.4.7
pytest==5.4.2
pytest-cov==2.9.0
Expand All @@ -43,6 +47,7 @@ pytz==2020.1
PyYAML==5.3.1
requests==2.23.0
requests-mock==1.8.0
rich==2.2.3
s3transfer==0.3.3
six==1.15.0
soupsieve==2.0.1
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ install_requires =
mf2py
mutagen
tinycss2
rich
# The usage of test_requires is discouraged, see `Dependency Management` docs
# tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
Expand Down
5 changes: 3 additions & 2 deletions src/nefelibata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import yaml
from libgravatar import Gravatar
from nefelibata import config_filename
from rich.logging import RichHandler


def get_config(root: Path) -> Dict[str, Any]:
Expand Down Expand Up @@ -36,9 +37,9 @@ def setup_logging(loglevel: str) -> None:
logformat = "[%(asctime)s] %(levelname)s: %(name)s: %(message)s"
logging.basicConfig(
level=level,
stream=sys.stdout,
format=logformat,
datefmt="%Y-%m-%d %H:%M:%S",
datefmt="[%X]",
handlers=[RichHandler()],
force=True,
)

Expand Down

0 comments on commit 874dc0e

Please sign in to comment.