Skip to content

Improve logging #42

@SlowMo24

Description

@SlowMo24

Logging errors works. Splitting logs into separate files would though improve readability.

I would suggest one file for each of the following

  • general logging (currently done to the console)
  • ohsome response
  • ohsome query parameters
  • ohsome bpolys parameter (if used)

the bboxes parameter is geojson but gets invalid when duped to json due to escaping. Also the geojson may get quite large even with a small amount of geometries making the log hard to read (see ohsome_exception_20210312T165323.json.txt)

This is some code I use for logging but that may not be good code!

#!/usr/bin/python

import os
global filepath
filepath=os.path.dirname(os.path.realpath(__file__))
import logging
logging.basicConfig(filename=os.path.join(filepath,'temp_automatic_workflow.log'),filemode='w',level=logging.DEBUG,format='%(asctime)s %(levelname)s %(message)s',force=True)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions