[Python-modules-commits] [python-coloredlogs] 01/05: New upstream version 7.3
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Fri Nov 3 11:51:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository python-coloredlogs.
commit 3706252f18b0b138d14e8e8460f75beabae50fc6
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Thu Nov 2 15:17:22 2017 +0000
New upstream version 7.3
---
MANIFEST.in | 1 +
PKG-INFO | 6 +--
README.rst | 4 +-
coloredlogs.egg-info/PKG-INFO | 6 +--
coloredlogs.egg-info/SOURCES.txt | 7 ++-
coloredlogs/__init__.py | 5 +-
coloredlogs/demo.py | 4 +-
coloredlogs/tests.py | 15 +++---
docs/conf.py | 83 +++++++++++++++++++++++++++++++++
docs/images/custom-colors.png | Bin 0 -> 95649 bytes
docs/images/custom-datetime-format.png | Bin 0 -> 77452 bytes
docs/images/custom-log-format.png | Bin 0 -> 90128 bytes
docs/index.rst | 29 ++++++++++++
requirements-tests.txt | 2 +-
14 files changed, 142 insertions(+), 20 deletions(-)
diff --git a/MANIFEST.in b/MANIFEST.in
index 41b05ab..e8e1f19 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,4 @@
include *.rst
include *.txt
include coloredlogs.pth
+graft docs
diff --git a/PKG-INFO b/PKG-INFO
index 83e7707..447f493 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: coloredlogs
-Version: 7.1
+Version: 7.3
Summary: Colored terminal output for Python's logging module
Home-page: https://coloredlogs.readthedocs.io
Author: Peter Odding
@@ -87,7 +87,7 @@ Description: coloredlogs: Colored terminal output for Python's logging module
import coloredlogs, logging
# Create a logger object.
- logger = logging.getLogger('your-module')
+ logger = logging.getLogger(__name__)
# By default the install() function installs a handler on the root logger,
# this means that log messages from your code and log messages from the
@@ -102,7 +102,7 @@ Description: coloredlogs: Colored terminal output for Python's logging module
# Some examples.
logger.debug("this is a debugging message")
logger.info("this is an informational message")
- logger.warn("this is a warning message")
+ logger.warning("this is a warning message")
logger.error("this is an error message")
logger.critical("this is a critical message")
diff --git a/README.rst b/README.rst
index 5edbb38..6b489dc 100644
--- a/README.rst
+++ b/README.rst
@@ -79,7 +79,7 @@ Here's an example of how easy it is to get started:
import coloredlogs, logging
# Create a logger object.
- logger = logging.getLogger('your-module')
+ logger = logging.getLogger(__name__)
# By default the install() function installs a handler on the root logger,
# this means that log messages from your code and log messages from the
@@ -94,7 +94,7 @@ Here's an example of how easy it is to get started:
# Some examples.
logger.debug("this is a debugging message")
logger.info("this is an informational message")
- logger.warn("this is a warning message")
+ logger.warning("this is a warning message")
logger.error("this is an error message")
logger.critical("this is a critical message")
diff --git a/coloredlogs.egg-info/PKG-INFO b/coloredlogs.egg-info/PKG-INFO
index 83e7707..447f493 100644
--- a/coloredlogs.egg-info/PKG-INFO
+++ b/coloredlogs.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: coloredlogs
-Version: 7.1
+Version: 7.3
Summary: Colored terminal output for Python's logging module
Home-page: https://coloredlogs.readthedocs.io
Author: Peter Odding
@@ -87,7 +87,7 @@ Description: coloredlogs: Colored terminal output for Python's logging module
import coloredlogs, logging
# Create a logger object.
- logger = logging.getLogger('your-module')
+ logger = logging.getLogger(__name__)
# By default the install() function installs a handler on the root logger,
# this means that log messages from your code and log messages from the
@@ -102,7 +102,7 @@ Description: coloredlogs: Colored terminal output for Python's logging module
# Some examples.
logger.debug("this is a debugging message")
logger.info("this is an informational message")
- logger.warn("this is a warning message")
+ logger.warning("this is a warning message")
logger.error("this is an error message")
logger.critical("this is a critical message")
diff --git a/coloredlogs.egg-info/SOURCES.txt b/coloredlogs.egg-info/SOURCES.txt
index 64eaf0e..96da32e 100644
--- a/coloredlogs.egg-info/SOURCES.txt
+++ b/coloredlogs.egg-info/SOURCES.txt
@@ -18,4 +18,9 @@ coloredlogs.egg-info/SOURCES.txt
coloredlogs.egg-info/dependency_links.txt
coloredlogs.egg-info/entry_points.txt
coloredlogs.egg-info/requires.txt
-coloredlogs.egg-info/top_level.txt
\ No newline at end of file
+coloredlogs.egg-info/top_level.txt
+docs/conf.py
+docs/index.rst
+docs/images/custom-colors.png
+docs/images/custom-datetime-format.png
+docs/images/custom-log-format.png
\ No newline at end of file
diff --git a/coloredlogs/__init__.py b/coloredlogs/__init__.py
index 4a7ca6c..6e49c98 100644
--- a/coloredlogs/__init__.py
+++ b/coloredlogs/__init__.py
@@ -1,7 +1,7 @@
# Colored terminal output for Python's logging module.
#
# Author: Peter Odding <peter at peterodding.com>
-# Last Change: July 15, 2017
+# Last Change: August 7, 2017
# URL: https://coloredlogs.readthedocs.io
"""
@@ -199,7 +199,7 @@ WINDOWS = sys.platform.startswith('win')
NEED_COLORAMA = WINDOWS
# Semi-standard module versioning.
-__version__ = '7.1'
+__version__ = '7.3'
DEFAULT_LOG_LEVEL = logging.INFO
"""The default log level for :mod:`coloredlogs` (:data:`logging.INFO`)."""
@@ -237,6 +237,7 @@ DEFAULT_LEVEL_STYLES = dict(
info=dict(),
notice=dict(color='magenta'),
warning=dict(color='yellow'),
+ success=dict(color='green', bold=CAN_USE_BOLD_FONT),
error=dict(color='red'),
critical=dict(color='red', bold=CAN_USE_BOLD_FONT))
"""Mapping of log level names to default font styles."""
diff --git a/coloredlogs/demo.py b/coloredlogs/demo.py
index 5085644..c6be1a7 100644
--- a/coloredlogs/demo.py
+++ b/coloredlogs/demo.py
@@ -1,7 +1,7 @@
# Demonstration of the coloredlogs package.
#
# Author: Peter Odding <peter at peterodding.com>
-# Last Change: May 17, 2017
+# Last Change: August 7, 2017
# URL: https://coloredlogs.readthedocs.io
"""A simple demonstration of the `coloredlogs` package."""
@@ -32,7 +32,7 @@ def demonstrate_colored_logging():
# DEBUG logging level but enable the user the customize it.
coloredlogs.install(level=os.environ.get('COLOREDLOGS_LOG_LEVEL', 'SPAM'))
# Print some examples with different timestamps.
- for level in ['spam', 'debug', 'verbose', 'info', 'notice', 'warn', 'error', 'critical']:
+ for level in ['spam', 'debug', 'verbose', 'info', 'success', 'notice', 'warning', 'error', 'critical']:
if hasattr(logger, level):
getattr(logger, level)("message with level %r", level)
time.sleep(DEMO_DELAY)
diff --git a/coloredlogs/tests.py b/coloredlogs/tests.py
index 0260e95..29a5ea6 100644
--- a/coloredlogs/tests.py
+++ b/coloredlogs/tests.py
@@ -1,7 +1,7 @@
# Automated tests for the `coloredlogs' package.
#
# Author: Peter Odding <peter at peterodding.com>
-# Last Change: July 15, 2017
+# Last Change: August 7, 2017
# URL: https://coloredlogs.readthedocs.io
"""Automated tests for the `coloredlogs` package."""
@@ -97,7 +97,7 @@ class ColoredLogsTestCase(unittest.TestCase):
# Make sure the default levels are translated as expected.
assert level_to_number('debug') == logging.DEBUG
assert level_to_number('info') == logging.INFO
- assert level_to_number('warn') == logging.WARNING
+ assert level_to_number('warning') == logging.WARNING
assert level_to_number('error') == logging.ERROR
assert level_to_number('fatal') == logging.FATAL
# Make sure bogus level names don't blow up.
@@ -189,11 +189,11 @@ class ColoredLogsTestCase(unittest.TestCase):
assert any(expected_message in line for line in handle)
def test_syslog_shortcut_enhanced(self):
- """Make sure that ``coloredlogs.install(syslog='warn')`` works."""
+ """Make sure that ``coloredlogs.install(syslog='warning')`` works."""
with cleanup_handlers():
the_expected_message = random_string(50)
not_an_expected_message = random_string(50)
- coloredlogs.install(syslog='warn')
+ coloredlogs.install(syslog='warning')
logging.info("%s", not_an_expected_message)
logging.warning("%s", the_expected_message)
if os.path.isfile(UNIX_SYSTEM_LOG):
@@ -262,7 +262,10 @@ class ColoredLogsTestCase(unittest.TestCase):
# NOTICE -> WARNING.
decrease_verbosity()
assert get_level() == logging.WARNING
- # WARNING -> ERROR.
+ # WARNING -> SUCCESS.
+ decrease_verbosity()
+ assert get_level() == logging.SUCCESS
+ # SUCCESS -> ERROR.
decrease_verbosity()
assert get_level() == logging.ERROR
# ERROR -> CRITICAL.
@@ -347,7 +350,7 @@ class ColoredLogsTestCase(unittest.TestCase):
for method, severity in ((logger.debug, 'DEBUG'),
(logger.info, 'INFO'),
(logger.verbose, 'VERBOSE'),
- (logger.warning, 'WARN'),
+ (logger.warning, 'WARNING'),
(logger.error, 'ERROR'),
(logger.critical, 'CRITICAL')):
# Prepare the text.
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..e6c320b
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,83 @@
+# Colored terminal output for Python's logging module.
+#
+# Author: Peter Odding <peter at peterodding.com>
+# Last Change: May 18, 2017
+# URL: https://coloredlogs.readthedocs.io
+
+"""Sphinx documentation configuration for the `coloredlogs` package."""
+
+import os
+import sys
+
+# Add the 'coloredlogs' source distribution's root directory to the module path.
+sys.path.insert(0, os.path.abspath(os.pardir))
+
+# -- General configuration -----------------------------------------------------
+
+# Sphinx extension module names.
+extensions = [
+ 'sphinx.ext.autodoc',
+ 'sphinx.ext.intersphinx',
+ 'sphinx.ext.viewcode',
+ 'humanfriendly.sphinx',
+]
+
+# Sort members by the source order instead of alphabetically.
+autodoc_member_order = 'bysource'
+
+# Paths that contain templates, relative to this directory.
+templates_path = ['templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'coloredlogs'
+copyright = u'2017, Peter Odding'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+
+# Find the package version and make it the release.
+from coloredlogs import __version__ as coloredlogs_version # noqa
+
+# The short X.Y version.
+version = '.'.join(coloredlogs_version.split('.')[:2])
+
+# The full version, including alpha/beta/rc tags.
+release = coloredlogs_version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+language = 'en'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['build']
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# Refer to the Python standard library.
+# From: http://twistedmatrix.com/trac/ticket/4582.
+intersphinx_mapping = dict(
+ python=('https://docs.python.org/2', None),
+ capturer=('https://capturer.readthedocs.io/en/latest', None),
+ humanfriendly=('https://humanfriendly.readthedocs.io/en/latest', None),
+)
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'nature'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'coloredlogsdoc'
diff --git a/docs/images/custom-colors.png b/docs/images/custom-colors.png
new file mode 100644
index 0000000..3765216
Binary files /dev/null and b/docs/images/custom-colors.png differ
diff --git a/docs/images/custom-datetime-format.png b/docs/images/custom-datetime-format.png
new file mode 100644
index 0000000..fd90e64
Binary files /dev/null and b/docs/images/custom-datetime-format.png differ
diff --git a/docs/images/custom-log-format.png b/docs/images/custom-log-format.png
new file mode 100644
index 0000000..c0eb833
Binary files /dev/null and b/docs/images/custom-log-format.png differ
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..1c5e3fa
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,29 @@
+.. include:: ../README.rst
+
+API documentation
+=================
+
+The following documentation is based on the source code of version |release| of
+the `coloredlogs` package.
+
+The most useful entry points into the documentation are
+:func:`~coloredlogs.install()`, :class:`~coloredlogs.ColoredFormatter` and
+:func:`~coloredlogs.syslog.enable_system_logging()`.
+
+The :mod:`coloredlogs` module
+-----------------------------
+
+.. automodule:: coloredlogs
+ :members:
+
+The :mod:`coloredlogs.converter` module
+---------------------------------------
+
+.. automodule:: coloredlogs.converter
+ :members:
+
+The :mod:`coloredlogs.syslog` module
+------------------------------------
+
+.. automodule:: coloredlogs.syslog
+ :members:
diff --git a/requirements-tests.txt b/requirements-tests.txt
index 7124b03..6e22b4f 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -3,4 +3,4 @@ coverage >= 4.2
mock >= 1.0.1
pytest >= 3.0.3
pytest-cov >= 2.3.1
-verboselogs >= 1.5
+verboselogs >= 1.7
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-coloredlogs.git
More information about the Python-modules-commits
mailing list