mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Merge pull request #168 from internetarchive/adds-hop-path-logging
Adds hop path logging
This commit is contained in:
commit
dea2d1c8fa
2
setup.py
2
setup.py
@ -2,7 +2,7 @@
|
|||||||
'''
|
'''
|
||||||
setup.py - setuptools installation configuration for warcprox
|
setup.py - setuptools installation configuration for warcprox
|
||||||
|
|
||||||
Copyright (C) 2013-2020 Internet Archive
|
Copyright (C) 2013-2021 Internet Archive
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -64,12 +64,17 @@ class CrawlLogger(object):
|
|||||||
else:
|
else:
|
||||||
content_length = 0
|
content_length = 0
|
||||||
payload_digest = '-'
|
payload_digest = '-'
|
||||||
|
logging.info('metadata %s', recorded_url.warcprox_meta)
|
||||||
|
hop_path = recorded_url.warcprox_meta["hop_path"] if "hop_path" in recorded_url.warcprox_meta and recorded_url.warcprox_meta["hop_path"] and len(recorded_url.warcprox_meta["hop_path"].strip()) > 0 else '-'
|
||||||
|
hop_path_parent = recorded_url.warcprox_meta["hop_path_parent"] if "hop_path_parent" in recorded_url.warcprox_meta else None
|
||||||
|
if hop_path_parent and hop_path_parent != recorded_url.url:
|
||||||
|
hop_path = str(hop_path if hop_path and hop_path != "-" else "") + "B"
|
||||||
fields = [
|
fields = [
|
||||||
'{:%Y-%m-%dT%H:%M:%S}.{:03d}Z'.format(now, now.microsecond//1000),
|
'{:%Y-%m-%dT%H:%M:%S}.{:03d}Z'.format(now, now.microsecond//1000),
|
||||||
'% 5s' % status,
|
'% 5s' % status,
|
||||||
'% 10s' % content_length,
|
'% 10s' % content_length,
|
||||||
recorded_url.url,
|
recorded_url.url,
|
||||||
'-', # hop path
|
hop_path,
|
||||||
recorded_url.referer or '-',
|
recorded_url.referer or '-',
|
||||||
recorded_url.mimetype if recorded_url.mimetype is not None and recorded_url.mimetype.strip() else '-',
|
recorded_url.mimetype if recorded_url.mimetype is not None and recorded_url.mimetype.strip() else '-',
|
||||||
'-',
|
'-',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user