Skip to content

Commit

Permalink
Merge pull request #20 from databio/dev
Browse files Browse the repository at this point in the history
0.2.6
  • Loading branch information
nsheff committed Mar 13, 2020
2 parents 5f3d908 + c60867b commit efd06af
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion 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/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.
Expand Down
27 changes: 17 additions & 10 deletions docs/changelog.md
@@ -1,48 +1,55 @@
# Changelog

## [0.2.5] -- (2019-11-01)
## [0.2.6] -- 2020-03-13
### Added
- license file
- Parameter in `init_logger` to use complete level names in fuller message format

### Changed
- Update testing requirements

## [0.2.5] -- 2019-11-01
### Added
- License for conda packaging

## [0.2.4] -- 2019-07-29

## [0.2.4] -- (2019-07-29)
### Added
- Add documentation
- New documentation

### Fixed
- Fix readme display

### Changed
- 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

2 changes: 1 addition & 1 deletion logmuse/_version.py
@@ -1 +1 @@
__version__ = "0.2.5"
__version__ = "0.2.6"
7 changes: 5 additions & 2 deletions logmuse/est.py
Expand Up @@ -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}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements-dev.txt
@@ -1,2 +1,2 @@
pytest==3.10.1
hypothesis
pytest>=4.6.9
hypothesis==4.38.0
3 changes: 2 additions & 1 deletion 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

0 comments on commit efd06af

Please sign in to comment.