Skip to content

Commit

Permalink
Add debug helper to print json dump
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Oct 10, 2023
1 parent 680820f commit 178433a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions recipes/includes/recipes_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ def get_script_json(
def extract_from_img_srcset(self, srcset: str, max_width=0):
return extract_from_img_srcset(srcset, max_width)

def debug_json_dump(self, obj, indent=2):
self.log.debug(json.dumps(obj, indent=indent))

def generate_debug_index(self, urls):
"""
Helper function to debug articles. To be used in parse_index().
Expand Down

0 comments on commit 178433a

Please sign in to comment.