public class LunaLogging extends Formatter
| Constructor and Description |
|---|
LunaLogging() |
| Modifier and Type | Method and Description |
|---|---|
String |
format(LogRecord record) |
static String |
getCallingClassName(int aInLevel)
Gets the name of the class calling the caller of this method.
|
static String |
getCallingClassName(Throwable aInThrowable,
int aInLevel)
Gets the name of the class that created the throwable.
|
static Logger |
getLogger()
Gets a logger whose category is the full name of the calling class.
|
static Logger |
getLogger(Class aInClass)
Gets a logger whose category is the full name of the given class.
|
static Logger |
getLogger(String aInClassName) |
static void |
updateLogger(Logger aInLogger) |
formatMessage, getHead, getTailpublic static void updateLogger(Logger aInLogger)
public static Logger getLogger(String aInClassName)
aInClassName - the calling class namepublic static Logger getLogger()
Intended for use as: private static final Logger logger = TPAResources.getLogger();It is an expensive operation to determine the calling class, so avoid creating transient loggers with this.
public static Logger getLogger(Class aInClass)
aInClass - the class for which a logger is being requestedpublic static String getCallingClassName(int aInLevel)
E.g. for a stack trace as follows: A.a() B.b() C.c() TPAResources.getCallingClassName(n) For n = 0 "B" is returned; for n = 1 "A" is returned.Note that this is a fairly expensive operation!!!
aInLevel - the number of levels above the caller to extractpublic static String getCallingClassName(Throwable aInThrowable, int aInLevel)
E.g. for a stack trace as follows: A.a() B.b() C.c() TPAResources.getCallingClassName(new Throwable(), n) For n = 0 "C" is returned; for n = 1 "B" is returned.Note that this is a fairly expensive operation!!!
aInThrowable - the exception to processaInLevel - the number of levels above the caller to extractCopyright 2014-2016 SafeNet Inc