Skip to content
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

Add method trace capability #1

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

greenlaw110
Copy link

new configuration: betterlogs.trace.level.

new behavior:

  1. when betterlogs.trace.level is equal or higher than application.log then enhance the source code so that on entry/exit(every return) of each application class methods body will be logged.
  2. when betterlogs.trace.mode set to NOTRACE, then only class/method/constructors explicitly marked with @trace annotation will be trace enhanced; if betterlogs.trace.mode set to TRACE, the all methods/contructors will be trace enhanced unless they are annotated with @notrace
  3. in the log info add thread ID information. Previous:
  • 11:04:18,625 INFO ~ [/app/controllers/Config.java:83] after() :: enter after
    Now:
    11:04:18,625 INFO ~ [/app/controllers/Config.java:83|17] after() :: enter after

Where "17" is the current thread ID

The documentation has been updated

@greenlaw110
Copy link
Author

Trace now support trace theme:

Call BetterLogsPlugin.setTraceThemes("order_process", "user_register", ...); to set current trace theme to be output

on your application methods, set trace theme(s);
@trace("order_process") public void orderForm(...) {...};
@trace("user_register") public void register(...) {...}

@greenlaw110 greenlaw110 reopened this Jun 11, 2011
@sgodbillon
Copy link
Owner

Hi,

Thanks for the pull request. Sorry for the delay.

Anyway, there are some problems :

  • your code relies on javassist >= 3.11 (javassist is 3.9 in play 1.2.2 ; since it is a 'sensible' dependency for the framework, BetterLogs should not depend on another javassist version)
  • please, do not change tab/spaces indentation. All tabs have been converted to spaces, so git considers that almost all lines of code have been altered
  • can you document what "themes" stand for ?

Thanks in advance,

Stephane

@greenlaw110
Copy link
Author

Hi,

The code updated to support javassist 3.9, and document updated with more information about trace theme.

However no changes has been made to the tab/space issue. I've used eclipse auto format to reformat all source code. And because the updates itself are even bigger than original betterlogs code. It's more like a complete rewrite than adding a few lines for bug fix or enhancement. Maybe you want to check it and replace the existing code base.

Thanks,
Green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants