Skip to content

Commit 25269bb

Browse files
committed
More docs
1 parent 09c8ad5 commit 25269bb

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,32 @@ except ValueError:
5959
logger.exception('Bad input', extra={'user entered': user_string})
6060
```
6161

62+
You can also name your logger instead of using the automatically generated one:
63+
```python
64+
import stackify
65+
66+
logger = stackify.getLogger('mymodule.myfile')
67+
```
68+
69+
## Internal Logger
70+
71+
This library has an internal logger it uses for debugging and messaging.
72+
For example, if you want to enable debug messages:
73+
```python
74+
import logging
75+
76+
logging.getLogger('stackify').setLevel(logging.DEBUG)
77+
```
78+
79+
By default, it will enable the default logging settings via `logging.basicConfig()`
80+
and print `WARNING` level messages and above. If you wish to set everything up yourself,
81+
just pass `basic_config=False` in `getLogger`:
82+
```python
83+
import stackify
84+
85+
logger = stackify.getLogger(basic_config=False)
86+
```
87+
6288
## Testing
6389
Run the test suite with setuptools:
6490
```bash

0 commit comments

Comments
 (0)