Skip to content

Commit 872fe4b

Browse files
authored
feat: log filename and lineno in flashinfer jit logger (#1461)
<!-- .github/pull_request_template.md --> ## 📌 Description This is useful for me to figure out the logs belong to which line during debugging. ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [ ] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. -->
1 parent eebb92d commit 872fe4b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

flashinfer/jit/core.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ def __init__(self, name):
3131
self.addHandler(logging.FileHandler(log_path))
3232
# set the format of the log
3333
self.handlers[0].setFormatter(
34-
logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
34+
logging.Formatter(
35+
"%(asctime)s - %(levelname)s - %(filename)s:%(lineno)d - flashinfer.jit: %(message)s"
36+
)
3537
)
3638
self.handlers[1].setFormatter(
37-
logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
39+
logging.Formatter(
40+
"%(asctime)s - %(levelname)s - %(filename)s:%(lineno)d - flashinfer.jit: %(message)s"
41+
)
3842
)
3943

40-
def info(self, msg):
41-
super().info("flashinfer.jit: " + msg)
42-
4344

4445
logger = FlashInferJITLogger("flashinfer.jit")
4546

0 commit comments

Comments
 (0)