File: log_output.py

package info (click to toggle)
python-osmapi 4.3.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 820 kB
  • sloc: python: 3,409; xml: 1,601; makefile: 45; sh: 14
file content (23 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import osmapi
import logging
from pprint import pformat
import urllib3

log = logging.getLogger(__name__)

loglevel = logging.DEBUG
logging.basicConfig(
    format="%(asctime)s %(name)s %(levelname)-8s %(message)s",
    level=loglevel,
    datefmt="%Y-%m-%d %H:%M:%S",
)
logging.captureWarnings(True)

# shut up DEBUG messages of specific loggers
logging.getLogger(osmapi.dom.__name__).setLevel(logging.INFO)
logging.getLogger(urllib3.__name__).setLevel(logging.INFO)


api = osmapi.OsmApi(api="https://api06.dev.openstreetmap.org")
node1 = api.NodeGet("1111")
log.debug(pformat(node1))