File: files.py

package info (click to toggle)
python-daiquiri 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 208 kB
  • sloc: python: 795; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 458 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import datetime
import logging

import daiquiri

daiquiri.setup(
    level=logging.DEBUG,
    outputs=(
        daiquiri.output.File("errors.log", level=logging.ERROR),
        daiquiri.output.TimedRotatingFile(
            "everything.log", level=logging.DEBUG, interval=datetime.timedelta(hours=1)
        ),
    ),
)

logger = daiquiri.getLogger(__name__)

logger.info("only to rotating file logger")
logger.error("both log files, including errors only")