Giter Club home page Giter Club logo

logging_tree's Introduction

Welcome to the logging_tree Python project repository!

You can install this package and read its documentation at the project’s official entry on the Python Package Index:

https://pypi.python.org/pypi/logging_tree

On Debian Testing and Unstable, you can install the package for the system Python versions with any of the standard Debian package tools:

$ sudo apt-get install python-logging-tree

The documentation is also available as the package docstring, kept inside of the logging_tree/__init__.py file here in the project repository.

logging_tree's People

Contributors

brandon-rhodes avatar brondsem avatar federicoceratto avatar genisysram avatar graingert avatar living180 avatar loganrosen avatar ralphbean avatar ryanhiebert avatar shalak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

logging_tree's Issues

Document symbol for propagate

Some nodes show up as:

o "pywiki"
others show up as

o<--"requests"

I'm assuming the ones with a left-pointing arrow are where propagate is True, and the ones with no arrow are where propagate is False? Assuming that's correct, it should be added to the documentation.

Exception if formatter doesn't have a _fmt attribute

Some formatters don't have a _fmt attribute (for example, the LogstashFormatterVersion1 from python-logstash). Logging_tree shouldn't assume that all formatters have a format string.

(Excellent tool otherwise, thanks!)

Tag the source

It would be very helpful if you could tag releases as well. This would enable distributions to fetch the package from GitHub instead of Pypi, where not all files are included.

Thanks

Overridden parent loggers

There is an (undocumented, AFAICT) property on the loggers called parent. This points to the parent logger, skipping missing loggers up the chain.

Celery uses this property in an interesting way. The get_task_logger function overrides that parent attribute, so that those loggers will inherit its formatters (which add some nice, useful context about the worker the log was written from, what task was running, etc). Unfortunately, it meant that I saw some very strange behavior from this tool, which assumes that the parent logger will always be something from the beginning of the current logger.

document what broken .parent means, and how to fix it

I'm getting this warning but I'm not sure what to do about it:

   o !-"basic"
   |   Broken .parent! Messages propagate to "celery.task"
   |   Level NOTSET so inherits level INFO
   |   Handler <kombu.log.NullHandler object at 0x7f67b630a2e8>

Failing tests on python-3.3

Curious!

--- SOURCES/logging_tree-1.1 » python3 -m unittest discover logging_tree
....EEEE...
======================================================================
ERROR: test_2_dot_5_handlers (tests.test_format.FormatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/threebean/rpmbuild/SOURCES/logging_tree-1.1/logging_tree/tests/test_format.py", line 137, in test_2_dot_5_handlers
    ah(logging.handlers.TimedRotatingFileHandler('/bar/two.txt'))
  File "/usr/lib64/python3.3/logging/handlers.py", line 203, in __init__
    BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay)
  File "/usr/lib64/python3.3/logging/handlers.py", line 58, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python3.3/logging/__init__.py", line 965, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python3.3/logging/__init__.py", line 987, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
TypeError: __init__() got an unexpected keyword argument 'encoding'

======================================================================
ERROR: test_2_dot_6_handlers (tests.test_format.FormatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/threebean/rpmbuild/SOURCES/logging_tree-1.1/logging_tree/tests/test_format.py", line 148, in test_2_dot_6_handlers
    ah(logging.handlers.WatchedFileHandler('/bar/three.txt'))
  File "/usr/lib64/python3.3/logging/handlers.py", line 421, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python3.3/logging/__init__.py", line 965, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python3.3/logging/__init__.py", line 987, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
TypeError: __init__() got an unexpected keyword argument 'encoding'

======================================================================
ERROR: test_fancy_tree (tests.test_format.FormatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/threebean/rpmbuild/SOURCES/logging_tree-1.1/logging_tree/tests/test_format.py", line 78, in test_fancy_tree
    log.addHandler(logging.FileHandler('/foo/log.txt'))
  File "/usr/lib64/python3.3/logging/__init__.py", line 965, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python3.3/logging/__init__.py", line 987, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
TypeError: __init__() got an unexpected keyword argument 'encoding'

======================================================================
ERROR: test_most_handlers (tests.test_format.FormatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/threebean/rpmbuild/SOURCES/logging_tree-1.1/logging_tree/tests/test_format.py", line 107, in test_most_handlers
    '/bar/one.txt', maxBytes=10000, backupCount=3))
  File "/usr/lib64/python3.3/logging/handlers.py", line 151, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python3.3/logging/handlers.py", line 58, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python3.3/logging/__init__.py", line 965, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python3.3/logging/__init__.py", line 987, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
TypeError: __init__() got an unexpected keyword argument 'encoding'

----------------------------------------------------------------------
Ran 11 tests in 0.002s

FAILED (errors=4)

FR: Show if the logging level is delegated or not

From the docs

The term ‘delegation to the parent’ means that if a logger has a level of NOTSET, its chain of ancestor loggers is traversed until either an ancestor with a level other than NOTSET is found, or the root is reached.

If an ancestor is found with a level other than NOTSET, then that ancestor’s level is treated as the effective level of the logger where the ancestor search began, and is used to determine how a logging event is handled.

It would be useful to present this information in some form.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.