Created
August 4, 2011 12:23
-
-
Save jamesmorgan/1125054 to your computer and use it in GitHub Desktop.
Deomstration using the Loggin annotation
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
package com.morgan.design.demo; | |
import org.springframework.stereotype.Component; | |
import com.morgan.design.demo.annotation.LogMe; | |
import com.morgan.design.demo.annotation.LoggingLevel; | |
@Component | |
public class LoggingExample { | |
@LogMe | |
public void logMe() { | |
// do something in your method | |
} | |
@LogMe(LoggingLevel.INFO) | |
public void logMeInfoWithMethodArgs(final String someStringArg, final int someIntArg) { | |
// do something in your method | |
} | |
@LogMe(LoggingLevel.WARN) | |
public void logMeWarningWithMethodArgs(final String someStringArg, final int someIntArg, final boolean someArgBoolean) { | |
// do something in your method | |
} | |
@LogMe(LoggingLevel.DEBUG) | |
public void logMeDebugWithMethodArgs(final String someStringArg, final int someIntArg, final boolean someArgBoolean, | |
final float someArgFloat) { | |
// do something in your method | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment