-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using multiple custom annotations for interception #54
Comments
Hayo, thanks for the issue. While I agree that Now, what I can do is:
With the new tracing context you could do something like: @Trace(context = [ "debug"])
fun test(){
}
//and later on on the intercept
Krang.addListener { functionName, parameters, context ->
//here, you can check for the tracing context passed with the annotation
} |
Thank you for considering this. I wonder if it would be feasible to allow creating custom annotations. I very much like the idea of a general-purpose instrumentation library, and I also like the word intercept—that's what is happening! If we could just choose our own names for the actual purposes. Seeing how you can create annotations for other annotations, I imagine being able to write something along @InterceptingAnnotation
annotation class DebugLog and then just use it in the code. And, for ultimate versatility, I imagine that if this annotation is also annotated with |
Hey sorry for not replying sooner, got caught up with some other stuff. I was thinking about this and my proposal is as follows: New name for the
|
This project seems to be well-suited for method call logging in debug builds. However,
@Intercept
is a bit vague a term, not reflecting the actual purpose of the annotation. Moreover, with debug logging, I can usually have trace- and debug-level log statements for different verbosity levels. So I would like to have something like@DebugLog
and@TraceLog
, and I would like to know which one was used in the listener.(I wonder if it's feasible to pass the annotation object itself to the listener, if retained at runtiume. This would allow using annotations with parameters!)
The text was updated successfully, but these errors were encountered: