diff --git a/.gitignore b/.gitignore index a2d877d..8060754 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build/* dist/* doc/*.log MANIFEST +venv/ diff --git a/LICENSE b/LICENSE index e85c707..ef3747b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Sam Clements +Copyright (c) 2012-2021 Sam Clements Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index c1f35ed..041bd4f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,31 @@ Log formatting with colors! [![](https://img.shields.io/pypi/l/colorlog.svg)](https://pypi.org/project/colorlog/) [![](https://img.shields.io/travis/borntyping/python-colorlog/master.svg)](https://travis-ci.org/borntyping/python-colorlog) -`colorlog.ColoredFormatter` is a formatter for use with Python's `logging` -module that outputs records using terminal colors. +Add colours to the output of Python's `logging` module. * [Source on GitHub](https://github.com/borntyping/python-colorlog) * [Packages on PyPI](https://pypi.org/pypi/colorlog/) -* [Builds on Travis CI](https://travis-ci.org/borntyping/python-colorlog) + +Status +------ + +colorlog currently requires Python 3.5 or higher. Older versions (below 5.x.x) +support Python 2.6 and above. + +* colorlog 6.x requires Python 3.5 or higher. +* colorlog 5.x is an interim version that will warn Python 2 users to downgrade. +* colorlog 4.x is the final version supporting Python 2. + +[colorama] is included as a required dependency and initialised when using +colorlog on Windows. + +This library is almost a decade old and supported a wide set of Python versions +for most of its life, which has made it a difficult library to add new features +to. colorlog 6 may break backwards compatibility so that newer features +can be added more easily, but may still not accept all changes or feature +requests. colorlog 4 might accept essential bugfixes but should not be +considered actively maintained and will not accept any major changes or new +features. Installation ------------ @@ -173,14 +192,6 @@ logger.setLevel('TRACE') logger.log(TRACE, 'a message using a custom level') ``` -Compatibility -------------- - -colorlog works on Python 2.6 and above, including Python 3. - -On Windows, [colorama] is required for `colorlog` to work properly. It will -automatically be included when installing `colorlog` on windows. - Tests ----- @@ -189,7 +200,7 @@ Tests similar to the above examples are found in `tests/test_colorlog.py`. Status ------ -colorlog is in maintainance mode. I try and ensure bugfixes are published, +colorlog is in maintenance mode. I try and ensure bugfixes are published, but compatibility with Python 2.6+ and Python 3+ makes this a difficult codebase to add features to. Any changes that might break backwards compatibility for existing users will not be considered. @@ -214,7 +225,7 @@ Projects using colorlog Licence ------- -Copyright (c) 2012-2020 Sam Clements +Copyright (c) 2012-2021 Sam Clements Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/colorlog/__init__.py b/colorlog/__init__.py index 39cd66c..a23b635 100644 --- a/colorlog/__init__.py +++ b/colorlog/__init__.py @@ -2,6 +2,9 @@ from __future__ import absolute_import +import sys +import warnings + from colorlog.colorlog import ( escape_codes, default_log_colors, @@ -43,3 +46,10 @@ "LevelFormatter", "TTYColoredFormatter", ) + +if sys.version_info > (3, 5): + warnings.warn( + "Colorlog 6.0.0 will require Python 3.5 or above. Pin 'colorlog<5' to your " + "dependencies if you require compatibility with older versions of Python. See " + "https://github.com/borntyping/python-colorlog#status for more information." + ) diff --git a/setup.py b/setup.py index 048e1eb..370dd11 100644 --- a/setup.py +++ b/setup.py @@ -2,8 +2,8 @@ setup( name="colorlog", - version="4.8.0", - description="Log formatting with colors!", + version="5.0.0", + description="Add colours to the output of Python's logging module.", long_description=open("README.md").read(), long_description_content_type="text/markdown", author="Sam Clements",