Update instrument_logging.py#1150
Merged
areibman merged 5 commits intoAgentOps-AI:mainfrom Jul 31, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Hi @Dwij1704 , updated the branch. Please let me know if any updates are required from my side. |
Member
|
@HarikrishnanK9 thanks for the PR! What's the latest status on this? |
Contributor
|
Haven't encountered this issue before but seems harmless, let's merge |
Contributor
|
thank you @HarikrishnanK9 , going to put this in the next release!! |
fenilfaldu
pushed a commit
that referenced
this pull request
Aug 4, 2025
Co-authored-by: Dwij <96073160+Dwij1704@users.noreply.github.com> Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📥 Pull Request
📘 Description
This PR exposes the
print_loggerfunction inagentops.logging.instrument_loggingat the module level to prevent compatibility issues with libraries likenumbathat rely on@infer_global(print).Specifically:
print_logger = Noneat the top ofinstrument_logging.pyprint_loggerasglobalinsidesetup_print_logger()before defining the functionprint_loggeris accessible as a module-level attributeThis allows Numba to resolve the function via
getattr()without raisingAttributeError, while preserving AgentOps’ logging behavior.🧪 Testing
agentops.init()works when used withnumba-based libraries likeopenai-whisperprint()is still intercepted and logged to the buffer loggerprint_loggerappears underdir(agentops.logging.instrument_logging)whisper,numba, and CrewAI stack with no crashesAttaching the before and after stages
Initiall Error Response
Successful run after proposed changes in instrument_logging.py file