Added medium syndication metadata

This commit is contained in:
Brandon Rozek 2023-02-18 21:37:22 -05:00
parent a51e20fbc7
commit a22bb998cb
14 changed files with 78 additions and 68 deletions

View file

@ -1,9 +1,11 @@
---
title: "Print Statements with Frame Information"
date: 2021-06-03T13:54:39-04:00
date: 2021-06-03 17:54:39
draft: false
tags: ["Testing"]
medium_enabled: true
medium_post_id: a811c52bda55
tags:
- Testing
title: Print Statements with Frame Information
---
I find it extremely useful to include frame information such as filename, line number, and current function in my print statements. Here's a couple ways that I've done that in the past.
@ -36,5 +38,4 @@ def debuglog(m):
lineno = last_frame_info.lineno if last_frame_info is not None else 1
function_name = last_frame_info.function if last_frame_info is not None else "<module>"
print(f"[{filename}:{lineno} {function_name}] {m}")
```
```