Update the docs

This commit is contained in:
Gavin M. Roy 2015-06-17 22:01:26 -04:00
parent 6a0dd8a61f
commit 467bd5d0f7
3 changed files with 27 additions and 13 deletions

View file

@ -13,7 +13,8 @@ templates_path = []
source_suffix = '.rst'
master_doc = 'index'
project = 'sprockets.logging'
copyright = '2015, Dave Shawley'
author = 'Dave Shawley'
copyright = '2015, AWeber Communications'
version = '.'.join(__version__.split('.')[0:1])
release = __version__
if len(version_info) > 3:
@ -25,4 +26,5 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'sprockets': ('https://sprockets.readthedocs.org/en/latest/', None),
'tornado': ('http://www.tornadoweb.org/en/stable/', None),
}

View file

@ -1,8 +1,21 @@
Version History
===============
`1.1.0`_ Jun 18, 2015
---------------------
- Added :class:`sprockets.logging.JSONRequestFormatter`
- Added :method:`sprockets.logging.tornado_log_function`
- Added convenience constants and methods as a pass through to Python's logging package:
- :data:`sprockets.logging.DEBUG` to :data:`logging.DEBUG`
- :data:`sprockets.logging.ERROR` to :data:`logging.ERROR`
- :data:`sprockets.logging.INFO` to :data:`logging.INFO`
- :data:`sprockets.logging.WARN` to :data:`logging.WARN`
- :data:`sprockets.logging.WARNING` to :data:`logging.WARNING`
- :method:`sprockets.logging.dictConfig` to :method:`logging.config.dictConfig`
- :method:`sprockets.logging.getLogger` to :method:`logging.getLogger`
`1.0.0`_ Jun 09, 2015
---------------------
- Added :class:`sprockets.logging.ContextFilter`
.. _1.1.0: https://github.com/sprockets/sprockets.logging/compare/1.0.0...1.1.0
.. _1.0.0: https://github.com/sprockets/sprockets.logging/compare/0.0.0...1.0.0

View file

@ -13,31 +13,30 @@ LOG_CONFIG = {
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout',
'formatter': 'simple',
'filters': ['context'],
},
'filters': ['context']
}
},
'formatters': {
'simple': {
'class': 'logging.Formatter',
'format': '%(levelname)s %(name)s: %(message)s [%(context)s]',
},
'()': sprockets.logging.JSONRequestFormatter
}
},
'filters': {
'context': {
'()': 'sprockets.logging.ContextFilter',
'properties': ['context'],
},
'properties': ['context']
}
},
'loggers': {
'tornado': {
'level': 'DEBUG',
},
'level': 'DEBUG'
}
},
'root': {
'handlers': ['console'],
'level': 'DEBUG',
'level': 'DEBUG'
},
'incremental': False,
'incremental': False
}
@ -69,7 +68,7 @@ if __name__ == '__main__':
app = web.Application([
web.url('/(?P<object_id>\w+)', RequestHandler,
kwargs={'parent_log': logger}),
])
], log_function=sprockets.logging.tornado_log_function)
app.listen(8000)
signal.signal(signal.SIGINT, sig_handler)
signal.signal(signal.SIGTERM, sig_handler)