com.sap.tc.mobile.logging
Class Location

java.lang.Object
  extended by com.sap.tc.mobile.logging.LogController
      extended by com.sap.tc.mobile.logging.Location

public abstract class Location
extends LogController

Logger for specific location.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sap.tc.mobile.logging.LogController
LogController.LogImplementation
 
Field Summary
 
Fields inherited from class com.sap.tc.mobile.logging.LogController
isPDA, mobileImpl, NULL_OBJECT, standardImpl
 
Constructor Summary
protected Location(java.lang.String name, LogController parent)
           
 
Method Summary
 boolean beDebug()
          Same as LogController.beLogged(int)but always checks for a debug message, that is a message with severity Severity.DEBUG.
 boolean beError()
          Same as LogController.beLogged(int)but always checks for an error message, that is a message with severity Severity.ERROR.
 boolean beInfo()
          Same as LogController.beLogged(int)but always checks for an informational message, that is a message with severity Severity.INFO.
 boolean beLogged(int severity)
          Checks whether a message with the specified severity would be written via this log controller.
 boolean bePath()
          Same as LogController.beLogged(int)but always checks for a path message, that is a message with severity Severity.PATH.
 void debug(Category category, java.lang.String subLoc, MsgObject messageObject)
          Log a message with severity Severity.DEBUG.
 void debug(Category category, java.lang.String subLoc, MsgObject messageObject, java.lang.Object[] args)
          Log a message with severity Severity.DEBUG.
 void debugT(Category category, java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.DEBUG.
 void debugT(java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.DEBUG.
 void error(Category category, java.lang.String subLoc, MsgObject messageObject)
          Log a message with severity Severity.ERROR.
 void error(Category category, java.lang.String subLoc, MsgObject messageObject, java.lang.Object[] args)
          Log a message with severity Severity.ERROR.
 void errorT(Category category, java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.ERROR.
 void errorT(java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.ERROR.
static Location getLocation(java.lang.Class cls)
          Create a new location.
static Location getLocation(java.lang.String name)
          Create a new location.
 Location getParent()
          Gets the parent location of this location.
static Location getRoot()
          Gets the mobileLocationRoot location (parent of every location).
static Location getStandardRoot()
           
 void info(Category category, java.lang.String subLoc, MsgObject messageObject)
          Log a message with severity Severity.INFO.
 void info(Category category, java.lang.String subLoc, MsgObject messageObject, java.lang.Object[] args)
          Log a message with severity Severity.INFO.
 void infoT(Category category, java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.INFO.
 void infoT(java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.INFO.
 void path(Category category, java.lang.String subLoc, MsgObject messageObject)
          Log a message with severity Severity.PATH.
 void path(Category category, java.lang.String subLoc, MsgObject messageObject, java.lang.Object[] args)
          Log a message with severity Severity.PATH.
 void pathT(Category category, java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.PATH.
 void pathT(java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args)
          Log a message with severity Severity.PATH.
 void traceThrowable(int severity, java.lang.String subLoc, MsgObject msgObject, java.lang.Object[] args, java.lang.Throwable exc)
          Trace an exception.
 void traceThrowable(int severity, java.lang.String subLoc, MsgObject msgObject, java.lang.Throwable exc)
          Trace an exception.
 void traceThrowableT(int severity, java.lang.String subLoc, java.lang.String msgClear, java.lang.Object[] args, java.lang.Throwable exc)
          Trace an exception.
 
Methods inherited from class com.sap.tc.mobile.logging.LogController
beFatal, beWarning, enableTrace, exceptionImpl, getChildren, getEffectiveSeverity, getMaximumSeverity, getMinimumSeverity, getName, getParentInt, init, isTraceEnabled, logImpl, logImpl, reset, resetAll, setEffectiveSeverity, setEffectiveSeverity, setMaximumSeverity, setMaximumSeverity, setMinimumSeverity, setMinimumSeverity, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Location

protected Location(java.lang.String name,
                   LogController parent)
Method Detail

getLocation

public static Location getLocation(java.lang.String name)
Create a new location.

Parameters:
name - location name.
Returns:
location instance.

getLocation

public static Location getLocation(java.lang.Class cls)
Create a new location.

Parameters:
cls - location class.
Returns:
location instance.

getRoot

public static Location getRoot()
Gets the mobileLocationRoot location (parent of every location).

Returns:
mobileLocationRoot location.

getStandardRoot

public static Location getStandardRoot()

getParent

public Location getParent()
Gets the parent location of this location.

Returns:
parent location.

beDebug

public boolean beDebug()
Description copied from class: LogController
Same as LogController.beLogged(int)but always checks for a debug message, that is a message with severity Severity.DEBUG.

Overrides:
beDebug in class LogController

bePath

public boolean bePath()
Description copied from class: LogController
Same as LogController.beLogged(int)but always checks for a path message, that is a message with severity Severity.PATH.

Overrides:
bePath in class LogController

beInfo

public boolean beInfo()
Description copied from class: LogController
Same as LogController.beLogged(int)but always checks for an informational message, that is a message with severity Severity.INFO.

Overrides:
beInfo in class LogController

beError

public boolean beError()
Description copied from class: LogController
Same as LogController.beLogged(int)but always checks for an error message, that is a message with severity Severity.ERROR.

Overrides:
beError in class LogController

beLogged

public boolean beLogged(int severity)
Description copied from class: LogController
Checks whether a message with the specified severity would be written via this log controller. The purpose of this method is to avoid evaluating the arguments of a logging call, which is expensive and would be superfluous if a message is not written because of its insufficient severity. The result returned is necessary but not sufficient for writing log messages, that is if the method returns false the message is not going to be written but not vice versa. To this end, the method checks whether the specified severity is equal to or higher than the effective severity of the controller. It does neither take into account severities assigned to relations with other log controllers nor filters associated with the log controller or logs. This version of the method is more efficient than the version also taking another log controller as argument, and therefore better fits the purpose to avoid inefficiencies.

Overrides:
beLogged in class LogController
Parameters:
severity - Severity of message to be written

debug

public final void debug(Category category,
                        java.lang.String subLoc,
                        MsgObject messageObject)
Log a message with severity Severity.DEBUG.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.

debug

public final void debug(Category category,
                        java.lang.String subLoc,
                        MsgObject messageObject,
                        java.lang.Object[] args)
Log a message with severity Severity.DEBUG.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.
args - arguments for the message.

debugT

public final void debugT(java.lang.String subLoc,
                         java.lang.String msgClear,
                         java.lang.Object[] args)
Log a message with severity Severity.DEBUG.

Parameters:
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

debugT

public final void debugT(Category category,
                         java.lang.String subLoc,
                         java.lang.String msgClear,
                         java.lang.Object[] args)
Log a message with severity Severity.DEBUG.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

path

public final void path(Category category,
                       java.lang.String subLoc,
                       MsgObject messageObject)
Log a message with severity Severity.PATH.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.

path

public final void path(Category category,
                       java.lang.String subLoc,
                       MsgObject messageObject,
                       java.lang.Object[] args)
Log a message with severity Severity.PATH.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.
args - arguments for the message.

pathT

public final void pathT(java.lang.String subLoc,
                        java.lang.String msgClear,
                        java.lang.Object[] args)
Log a message with severity Severity.PATH.

Parameters:
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

pathT

public final void pathT(Category category,
                        java.lang.String subLoc,
                        java.lang.String msgClear,
                        java.lang.Object[] args)
Log a message with severity Severity.PATH.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

info

public final void info(Category category,
                       java.lang.String subLoc,
                       MsgObject messageObject)
Log a message with severity Severity.INFO.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.

info

public final void info(Category category,
                       java.lang.String subLoc,
                       MsgObject messageObject,
                       java.lang.Object[] args)
Log a message with severity Severity.INFO.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.
args - arguments for the message.

infoT

public final void infoT(java.lang.String subLoc,
                        java.lang.String msgClear,
                        java.lang.Object[] args)
Log a message with severity Severity.INFO.

Parameters:
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

infoT

public final void infoT(Category category,
                        java.lang.String subLoc,
                        java.lang.String msgClear,
                        java.lang.Object[] args)
Log a message with severity Severity.INFO.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

error

public final void error(Category category,
                        java.lang.String subLoc,
                        MsgObject messageObject)
Log a message with severity Severity.ERROR.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.

error

public final void error(Category category,
                        java.lang.String subLoc,
                        MsgObject messageObject,
                        java.lang.Object[] args)
Log a message with severity Severity.ERROR.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
messageObject - message object to log.
args - arguments for the message.

errorT

public final void errorT(java.lang.String subLoc,
                         java.lang.String msgClear,
                         java.lang.Object[] args)
Log a message with severity Severity.ERROR.

Parameters:
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

errorT

public final void errorT(Category category,
                         java.lang.String subLoc,
                         java.lang.String msgClear,
                         java.lang.Object[] args)
Log a message with severity Severity.ERROR.

Parameters:
category - category of this message.
subLoc - sublocation (e.g., a method name).
msgClear - clear-text message.
args - arguments for the message.

traceThrowable

public final void traceThrowable(int severity,
                                 java.lang.String subLoc,
                                 MsgObject msgObject,
                                 java.lang.Throwable exc)
Trace an exception.

Parameters:
severity - message severity.
subLoc - sublocation (e.g., method name).
msgObject - message object.
exc - exception to log.

traceThrowable

public final void traceThrowable(int severity,
                                 java.lang.String subLoc,
                                 MsgObject msgObject,
                                 java.lang.Object[] args,
                                 java.lang.Throwable exc)
Trace an exception.

Parameters:
severity - message severity.
subLoc - sublocation (e.g., method name).
msgObject - message object.
args - arguments for the message.
exc - exception to log.

traceThrowableT

public final void traceThrowableT(int severity,
                                  java.lang.String subLoc,
                                  java.lang.String msgClear,
                                  java.lang.Object[] args,
                                  java.lang.Throwable exc)
Trace an exception.

Parameters:
severity - message severity.
subLoc - sublocation (e.g., method name).
msgClear - clear-text message.
args - arguments for the message.
exc - exception to log.