Skip to content

Commit cb97c68

Browse files
committed
add missing kwargs for init_non_web
1 parent 7bea644 commit cb97c68

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7+
## 1.0.3 - 2019-07-20
8+
- add missing kwargs for init_non_web
9+
710
## 1.0.2 - 2019-07-20
811
- add method to support getting request logger by using method json_logging.get_request_logger(), fix #23
912

json_logging/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def config_root_logger():
9797
"logging.basicConfig() or logging.getLogger('root')")
9898

9999

100-
def init_non_web():
101-
__init()
100+
def init_non_web(**kwargs):
101+
__init(**kwargs)
102102

103103

104104
def __init(framework_name=None, custom_formatter=None):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="json-logging",
15-
version='1.0.2',
15+
version='1.0.3',
1616
packages=find_packages(exclude=['contrib', 'docs', 'tests*', 'example', 'dist', 'build']),
1717
license='Apache License 2.0',
1818
description="JSON Python Logging",

test.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Create the application instance
2+
import logging
3+
import sys
4+
from logging.handlers import TimedRotatingFileHandler
5+
6+
import connexion
7+
8+
import json_logging
9+
10+
app = connexion.App(__name__, specification_dir='./')
11+
12+
json_logging.ENABLE_JSON_LOGGING = True
13+
json_logging.init_connexion()
14+
json_logging.init_request_instrument(app)
15+
16+
json_logging._logger
17+
logger = logging.getLogger("test-logger")
18+
logger.setLevel(logging.DEBUG)
19+
logger.addHandler(logging.StreamHandler(sys.stdout))
20+
21+
handler = TimedRotatingFileHandler('info.log', 'midnight', 1, utc=True)
22+
logger.addHandler(handler)
23+
24+
if __name__ == '__main__':
25+
app.run()

0 commit comments

Comments
 (0)