Skip to content

Commit 6bde97b

Browse files
committed
Create README and configure tox properly
1 parent b823251 commit 6bde97b

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

README.rst

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
=============
2+
FIAAS Logging
3+
=============
4+
5+
This library configures logging according to the current FIAAS recomended format.
6+
7+
Usage::
8+
9+
from fiaas_logging import init_logging
10+
11+
init_logging(format="json")
12+
13+
14+
This would configure your application to emit JSON formatted logs on STDOUT.
15+
16+
Available options (all are keyword arguments to `init_logging`):
17+
18+
19+
====== =============== =================================================
20+
Key Possible values Meaning
21+
====== =============== =================================================
22+
format `json`/`plain` Select either JSON logging, or plain text logging
23+
debug `True`/`False` Enable debug logging
24+
====== =============== =================================================
25+
26+
The plain format contains the fields timestamp, level name, message, logger name, and thread name.
27+
In the json format, there are more fields, with more detail. The fields in the json output are:
28+
29+
============ =======================================================================
30+
Name Meaning
31+
============ =======================================================================
32+
@timestamp Timestamp of message
33+
@version Version, legacy field to support ELK stack at FINN (to be removed?)
34+
LocationInfo A structure describing the code location that logged this message
35+
message The actual log message
36+
extras A structure containing extra fields. Used for thread context
37+
throwable A formatted stacktrace if the log message is the result of an exception
38+
============ =======================================================================

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
test=pytest
33

44
[tool:pytest]
5-
addopts = --junitxml=build/reports/tests/junit.xml --cov=fiaas_logging --cov-report html --cov-report term --cov-report xml
5+
addopts = --junitxml=build/reports/tests/junit.xml
66

77
[coverage:html]
88
directory=build/reports/coverage

setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
]
2626

2727
TESTS_REQ = [
28-
"tox == 3.14.5",
29-
"tox-venv==0.4.0",
3028
"pytest == 4.6.9",
3129
"pytest-cov == 2.8.1",
3230
"pytest-html == 1.22.1",

tox.ini

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
[tox]
22
envlist = py27,py36,py37,py38
33
skip_missing_interpreters=True
4+
minversion=3.14
5+
requires=
6+
tox-venv
47

58
[testenv]
69
usedevelop=True
10+
download=True
711
deps=.[dev]
812
setenv =
913
TMP = {envtmpdir}
1014
passenv =
1115
HOME
1216
commands=prospector
13-
py.test
17+
!py38: py.test
18+
py38: py.test --cov=fiaas_logging --cov-report html --cov-report term --cov-report xml
1419

1520
[testenv:coverage]
1621
usedevelop=True
1722
deps=.[dev,codacy]
1823
passenv =
1924
HOME
2025
CODACY_PROJECT_TOKEN
21-
commands=py.test
26+
commands=py.test --cov=fiaas_logging --cov-report html --cov-report term --cov-report xml
2227
python-codacy-coverage -r ./build/reports/coverage.xml

0 commit comments

Comments
 (0)