-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
131 lines (105 loc) · 4.08 KB
/
index.html
File metadata and controls
131 lines (105 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
layout: default
---
<style>
.btn-outline-inverse {
color: #fff;
background-color: transparent;
border-color: #E95420;
}
</style>
<div class="header-container jumbotron">
<div class="container">
<h1>Mondrian</h1>
<h2>Python's logging module on steroids</h2>
<p>Mondrian configures the python standard logging module with reasonable defaults, and enhance its default
output formatters for better readability.</p>
<p class="text-center">
<a class="btn btn-primary btn-lg" href="https://pypi.org/project/mondrian/" target="_blank"
role="button">Install</a>
<a class="btn btn-primary btn-outline-inverse btn-lg" href="#documentation"
role="button">Documentation</a>
</p>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-10">
<h2 class="header-light regular-pad">What is Mondrian?</h2>
<blockquote>
<p>
Mondrian is a small library that will make you use python <code>logging</code> module, once and for
all.
</p>
<p>
Most python coders who avoids the systematic usage of <code>logging</code> in their projects does
so because it feels complicated to setup, but it's not.
</p>
<p>
Mondrian provides a one-call interface to its configuration, with pretty formatters that makes you
feel great.
</p>
</blockquote>
</div>
<div class="col-md-2 text-center">
<br>
<div class="clearfix">
<div class="pull-left" style="margin-right:0.5em">
<a class="github-button" href="https://github.com/python-mondrian/mondrian/fork"
data-icon="octicon-repo-forked" data-size="large" aria-label="Fork Mondrian on GitHub"></a>
</div>
<div class="pull-left">
<a class="github-button" href="https://github.com/python-mondrian/mondrian" data-icon="octicon-star"
data-size="large" data-show-count="true" aria-label="Star Mondrian on GitHub">Star</a>
</div>
</div>
<img src="img/mondrian-logo.png" alt="Mondrian, python's logging on steroids."
class="img-responsive">
<a name="documentation"></a>
</div>
</div>
<hr>
<div class="row">
<h2>Quick start</h2>
<p>Install the <code>mondrian</code> package:</p>
<pre><code> $ pip install mondrian</code></pre>
<p>In your project's entrypoints (for example, <code><yourpackage>/__main__.py</code>, call
<code>mondrian.setup()</code>:</p>
<pre><code class="python">import mondrian
import logging
logger = logging.getLogger()
def main():
...
logger.info('Hello')
...
if __name__ == '__main__':
mondrian.setup(excepthook=True)
logger.setLevel(logging.INFO)
main()</code></pre>
<p>
You can remove the <code>excepthook=True</code> if you don't want mondrian to override the default exception
handler for better formating. But it's nice, try it first.
</p>
<p>
Now, use python's <code>logging</code> module in your project's files:
</p>
<pre><code class="python">import logging
logger = logging.getLogger(__name__)
def some_very_nice_function():
...
logger.warning('Ola amigo!')
...</code></pre>
<p>That's all, folks!</p>
<div class="text-center">
<img src="img/example.png" style="max-width: 718px; margin: auto;" alt="Your python logger now looks like this"
class="img-responsive">
</div>
</div>
<hr>
<div class="row">
<h2>License</h2>
<p>
Mondrian and the surrounding material (like this website) is licensed under the Apache License, version 2.0.
</p>
</div>
</div>