https://github.com/alexxit/yamlconf
https://github.com/alexxit/yamlconf
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/alexxit/yamlconf
- Owner: AlexxIT
- Created: 2019-03-29T18:13:40.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T13:49:54.000Z (about 7 years ago)
- Last Synced: 2025-02-05T16:16:54.183Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Store app config in yaml file
```yaml
logging:
formatters:
stream: {format: "%(asctime)s %(levelname)s [%(name)s] %(message)s"}
syslog: {format: "%(asctime)s %(name)s python: %(message)s"}
handlers:
stream:
class: logging.handlers.SysLogHandler
stream: ext://sys.stdout
formatter: stream
syslog:
class: logging.handlers.SysLogHandler
address: ['127.0.0.1', 5140]
formatter: syslog
loggers:
asyncio: {level: WARNING}
urllib3.connectionpool: {level: INFO}
websockets.protocol: {level: WARNING}
root:
level: DEBUG
handlers: [stream, syslog]
server:
user: ...
pass: ...
```
OR
```yaml
logging:
filename: "app.log"
datefmt: "[%Y-%m-%d %H:%M:%S %z]"
format: "%(asctime)s %(levelname)s [%(name)s] %(message)s"
level: DEBUG
server:
user: ...
pass: ...
```
## Changelog
### 0.1.3 - 2019-04-20
- Change to `yaml.safe_load`
- Change `error` to `exception`
### 0.1.2 - 2019-04-05
- Add `basicConfig` version
### 0.1.1 - 2019-04-01
- Fix empty logging in conf