internetarchive / warcprox

WARC writing MITM HTTP/S proxy
378 stars 54 forks source link

Add option to load logging conf from YAML file #116

Closed vbanos closed 5 years ago

vbanos commented 5 years ago

New option --logging-conf-file to load logging conf from a JSON file.

Prefer JSON over the configparser format supported by logging.config.fileConfig because JSON format is much better (nesting is supported) and its easier to detect errors.

nlevitt commented 5 years ago

Hey @vbanos, yaml is a better config file format that json (I heard that first from @kngenie and I agree). Can we switch this to use yaml?

vbanos commented 5 years ago

Yes, I totally agree YAML is better. I use it for everything.

We would have to add PyYAML as a dependency, this is why I did it with JSON. If thats OK, I'd be happy to switch to YAML.

nlevitt commented 5 years ago

Oh I see. I didn't realize warcprox didn't have pyyaml as a dependency yet. Yeah I think that's fine, you can add it.

vbanos commented 5 years ago

OK, I switched from JSON to YAML.

nlevitt commented 5 years ago

Looks great, except, could you switch it to pyyaml>=5.1 and use yaml.safe_load()? No need to get stuck with an old version and use a potentially unsafe code path, seems to me.

vbanos commented 5 years ago

NP, its done :)

nlevitt commented 5 years ago

Thanks!