INNER CODE UNIT · Python
end
lebinh/ngxtop · ngxtop/ngxtop.py:391
end = min(len(json_str), e.pos + 20)
logging.info(f"JSON around error position: ...{json_str[start:end]}...")
logging.info(f" {' ' * (e.pos - start - 3)}^")
# Output the complete line for analysis
logging.info(f"Complete line from beginning ({len(line)} chars):")
# Show first 100 chars to see the prefix, then ... then area around JSON start
if len(line) > 200:
prefix = line[:100]
json_area = line[max(0, json_start-20):json_start+80]
logging.info(f"{prefix}...{json_area}...")
else:
logging.info(line.rstrip())
# Output the extracted JSON string
logging.info(f"Extracted JSON string ({len(json_str)} chars):")
logging.info(json_str)
logging.info("="*80)