From 6fe997fd6d69febd49ef7ae8943e3533ae443013 Mon Sep 17 00:00:00 2001 From: Michal Stolarczyk Date: Wed, 8 Jan 2020 11:11:07 -0500 Subject: [PATCH 1/8] update pytest requirements --- logmuse/_version.py | 2 +- requirements/requirements-test.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/logmuse/_version.py b/logmuse/_version.py index fe404ae..6d0a52e 100644 --- a/logmuse/_version.py +++ b/logmuse/_version.py @@ -1 +1 @@ -__version__ = "0.2.5" +__version__ = "0.2.6-dev" diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt index 9f0c760..48d4924 100644 --- a/requirements/requirements-test.txt +++ b/requirements/requirements-test.txt @@ -1,2 +1,3 @@ coveralls>=1.1 -pytest-cov==2.6.1 +pytest-cov>=2.8.1 +pytest>=4.6.9 \ No newline at end of file From 8d599d6ccd5a6681edc13589a1aad08a8557428c Mon Sep 17 00:00:00 2001 From: Michal Stolarczyk Date: Wed, 8 Jan 2020 11:12:59 -0500 Subject: [PATCH 2/8] update dev pytest requirement --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index de8e1f3..b3a5ab1 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,2 +1,2 @@ -pytest==3.10.1 +pytest>=4.6.9 hypothesis From 15897addbcace67b26e778a437bf3cfe021f7b63 Mon Sep 17 00:00:00 2001 From: Michal Stolarczyk Date: Wed, 8 Jan 2020 11:19:11 -0500 Subject: [PATCH 3/8] test hypothesis req change --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index b3a5ab1..cd34363 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,2 +1,2 @@ pytest>=4.6.9 -hypothesis +hypothesis==4.38.0 From f8ca92bcb6435bfc659f80c689a896d41a96cc3f Mon Sep 17 00:00:00 2001 From: Vince Date: Mon, 13 Jan 2020 16:48:53 -0500 Subject: [PATCH 4/8] opt-out for truncated level names in dev msg fmt; close #17 --- docs/changelog.md | 4 ++++ logmuse/est.py | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 31daacc..36ccd8f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased] +### Added +- Parameter in `init_logger` to use complete level names in fuller message format + ## [0.2.5] -- (2019-11-01) ### Added - license file diff --git a/logmuse/est.py b/logmuse/est.py index d5d825d..fab1ff4 100644 --- a/logmuse/est.py +++ b/logmuse/est.py @@ -22,6 +22,7 @@ BASIC_LOGGING_FORMAT = "%(message)s" DEV_LOGGING_FMT = "%(levelname).4s %(asctime)s | %(name)s:%(module)s:%(lineno)d > %(message)s " +FULL_DEV_LOGGING_FMT = "%(levelname)s %(asctime)s | %(name)s:%(module)s:%(lineno)d > %(message)s " DEFAULT_DATE_FMT = "%H:%M:%S" PACKAGE_NAME = "logmuse" STREAMS = {"OUT": sys.stdout, "ERR": sys.stderr} @@ -116,7 +117,8 @@ def logger_via_cli(opts, strict=True, **kwargs): def init_logger( name="", level=None, stream=None, logfile=None, make_root=None, propagate=False, silent=False, devmode=False, - verbosity=None, fmt=None, datefmt=DEFAULT_DATE_FMT, plain_format=False, style=None): + verbosity=None, fmt=None, datefmt=DEFAULT_DATE_FMT, plain_format=False, + style=None, use_full_names=False): """ Establish and configure primary logger. @@ -160,6 +162,7 @@ def init_logger( :param str style: string indicating message formatting strategy; refer to https://docs.python.org/3/howto/logging-cookbook.html#use-of-alternative-formatting-styles; only valid in Python3.2+ + :param bool use_full_names: don't truncate level names :return logging.Logger: configured Logger instance :raise ValueError: if attempting to name explicitly non-root logger with a root name, or if both level and verbosity are specified @@ -243,7 +246,7 @@ def init_logger( get_fmt = (lambda _: fmt) if fmt else ( lambda hdlr: BASIC_LOGGING_FORMAT if plain_format or not (devmode or fine or isinstance(hdlr, logging.FileHandler)) else - DEV_LOGGING_FMT) + (FULL_DEV_LOGGING_FMT if use_full_names else DEV_LOGGING_FMT)) fmt_kwargs = {"datefmt": datefmt} if style: From f828981775662bf90829b24178b80ee711709bba Mon Sep 17 00:00:00 2001 From: Nathan Sheffield Date: Fri, 13 Mar 2020 12:30:16 -0400 Subject: [PATCH 5/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca24618..aa9e304 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # logmuse -[![Build Status](https://travis-ci.org/vreuter/logmuse.svg?branch=master)](https://travis-ci.org/vreuter/logmuse) +[![Build Status](https://travis-ci.org/databio/logmuse.svg?branch=master)](https://travis-ci.org/vreuter/logmuse) [![Coverage Status](https://coveralls.io/repos/github/vreuter/logmuse/badge.svg?branch=master)](https://coveralls.io/github/vreuter/logmuse?branch=master) Logmuse is a small logging setup package. The point of logmuse is to make it super simple to add CLI-control of logging to your python CLI tool. It just provides a simple interface so that standard arguments can be passed on to the logger. From 4103fbb0ff25429a0c1d529365b8514614abcb54 Mon Sep 17 00:00:00 2001 From: Nathan Sheffield Date: Fri, 13 Mar 2020 12:30:48 -0400 Subject: [PATCH 6/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa9e304..2059180 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # logmuse -[![Build Status](https://travis-ci.org/databio/logmuse.svg?branch=master)](https://travis-ci.org/vreuter/logmuse) +[![Build Status](https://travis-ci.org/databio/logmuse.svg?branch=master)](https://travis-ci.org/databio/logmuse) [![Coverage Status](https://coveralls.io/repos/github/vreuter/logmuse/badge.svg?branch=master)](https://coveralls.io/github/vreuter/logmuse?branch=master) Logmuse is a small logging setup package. The point of logmuse is to make it super simple to add CLI-control of logging to your python CLI tool. It just provides a simple interface so that standard arguments can be passed on to the logger. From b2c88499793cedf575424080a05be3d1c2ddf003 Mon Sep 17 00:00:00 2001 From: nsheff Date: Fri, 13 Mar 2020 12:38:24 -0400 Subject: [PATCH 7/8] version bump, changelog --- docs/changelog.md | 21 ++++++++++++++------- logmuse/_version.py | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index c604296..0e52909 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,38 +1,45 @@ # Changelog -## [0.2.4] -- (2019-07-29) +## [0.2.6] -- 2020-03-13 +- Update testing requirements +- Add new option for full flag names in message format + +## [0.2.5] -- 2019-11-01 +- Added license for conda packaging + +## [0.2.4] -- 2019-07-29 - Add documentation - Fix readme display - Tweak variable names -## [0.2.1] -- (2019-07-02) +## [0.2.1] -- 2019-07-02 ### Added - Control for strictness of requirement for client code to have called `add_logging_options` when prior to using `logger_via_cli` ### Fixed - Remove erroneous printing of invalid stream location message. -## [0.2.0] -- (2019-06-02) +## [0.2.0] -- 2019-06-02 ### Changed - Deprecated `setup_logger` in favor of `init_logger` - Changed argparser help interface to fit each arg on one line -## [0.1.0] -- (2019-04-30) +## [0.1.0] -- 2019-04-30 ### Added - Parameter to `setup_logger` to pass argument to `style` parameter of `logging.Formatter` -## [0.0.2] -- (2019-04-14) +## [0.0.2] -- 2019-04-14 ### Changed - Lessen level of some messages ### Fixed - Avoid erroneous missing-option exception when adding standard logging options -## [0.0.1] -- (2019-04-09) +## [0.0.1] -- 2019-04-09 ### Fixed - Fixed a bug preventing installation -## [0.0.0] -- (2019-04-08): +## [0.0.0] -- 2019-04-08 - Initial release diff --git a/logmuse/_version.py b/logmuse/_version.py index 788da1f..fe404ae 100644 --- a/logmuse/_version.py +++ b/logmuse/_version.py @@ -1 +1 @@ -__version__ = "0.2.4" +__version__ = "0.2.5" From c60867b7b853ec127851e087d8f160ffa9cda5a5 Mon Sep 17 00:00:00 2001 From: nsheff Date: Fri, 13 Mar 2020 12:42:36 -0400 Subject: [PATCH 8/8] fix version --- logmuse/_version.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/logmuse/_version.py b/logmuse/_version.py index 3a26748..01ef120 100644 --- a/logmuse/_version.py +++ b/logmuse/_version.py @@ -1,5 +1 @@ -<<<<<<< HEAD -__version__ = "0.2.5" -======= -__version__ = "0.2.6-dev" ->>>>>>> f395cb8ef8d55b461b4fe9dba8b035d75576e150 +__version__ = "0.2.6"