|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bees.core.Capability | +--bees.core.resource.LoggerSpec | +--bees.core.resource.Logger
The Logger capability provides logging functionality using another capability that provides an OutputStream. The only real advantage a Logger has over the OutputStream is that it can put an unforgeable prefix on each log entry, which is convenient for sharing log files.
Field Summary | |
static PermissionSet |
DEFAULT_PERMISSIONS
The default permissions for Logger capability. |
static Permission |
LEVEL_PERMISSION
The permission containing the maximum LogLevel value for this Logger. |
static IntegerPermission[] |
LEVEL_PERMISSIONS
An array of IntegerPermissions corresponding to each LogLevel. |
static EnumerationPair[] |
LEVEL_TYPES
An array of EnumerationPairs that map the LogLevel name to the LogLevel integer value. |
Fields inherited from class bees.core.resource.LoggerSpec |
INVALID_LEVEL, LF_BDOMAIN_PREFIX |
Fields inherited from class bees.core.Capability |
DELETE_PERMISSION, id, INVALID_ID |
Fields inherited from interface edu.utah.janos.io.LogLevel |
ALERT, CRIT, DBG, EMERG, ERR, ERROR, INFO, LEVEL_NAMES, MAX, MIN, NOTICE, WARNING |
Constructor Summary | |
Logger()
Construct an empty Logger capability. |
Method Summary | |
static Logger |
currentLogger()
|
protected void |
fromBytes(byte[] flattened,
CapabilityEnvelope[] sub)
Bind this capability to the given object. |
void |
getSuites(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
|
void |
handleMessage(edu.utah.janosvm.kit.comm.jsi.JSIHandlerContext jhc,
edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
|
static void |
log(int level,
java.lang.String msg)
Log a message to the default domain logger at a given level of importance. |
static void |
log(int level,
java.lang.Throwable th)
Log a Throwable to the default domain logger at a given level of importance. |
static void |
log(java.lang.String msg)
Log a message to the default domain logger at the debug level. |
static void |
log(java.lang.Throwable th)
Log a Throwable to the default domain logger at the EMERGency level. |
void |
logMessage(int level,
java.lang.String msg)
Log a message at the given level of importance. |
void |
logMessage(java.lang.String msg)
Log a message at the debug level. |
void |
logThrowable(int level,
java.lang.Throwable th)
Log a Throwable at a given level of importance. |
void |
logThrowable(java.lang.Throwable th)
Log a Throwable at the EMERGency level. |
edu.utah.janosvm.kit.comm.jsi.JSIHandler |
resolveSpecifier(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm,
edu.utah.janosvm.kit.comm.jsi.JSIPair jp)
|
void |
revoke()
Revoke access to the capability. |
static void |
setCurrent(Logger logger)
Set the current logger for this Domain. |
void |
start()
Start the logger by adding a LogListener to the internal jnodeos Log object. |
java.lang.String |
toString()
|
Methods inherited from class bees.core.resource.LoggerSpec |
getFactory, specFromBytes, toBytes |
Methods inherited from class bees.core.Capability |
checkPermission, clear, clonePermission, deleteCapability, equals, fromBytes, revokedPermission, revokePermission, revokePermissions, valid |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Permission LEVEL_PERMISSION
public static final IntegerPermission[] LEVEL_PERMISSIONS
public static final EnumerationPair[] LEVEL_TYPES
public static final PermissionSet DEFAULT_PERMISSIONS
Constructor Detail |
public Logger()
Method Detail |
public static void setCurrent(Logger logger)
logger
- The Logger to use as the default log for this Domain.public static Logger currentLogger()
public static void log(int level, java.lang.String msg)
level
- A LogLevel value.msg
- The message to append to the log.public static void log(java.lang.String msg)
msg
- The message to append to the log.public static void log(int level, java.lang.Throwable th)
level
- A LogLevel value.th
- The exception to log.public static void log(java.lang.Throwable th)
th
- The exception to log.public void revoke()
Capability
revoke
in class LoggerSpec
Capability.revoke()
protected final void fromBytes(byte[] flattened, CapabilityEnvelope[] sub) throws java.lang.Exception
Capability
fromBytes
in class Capability
Capability.fromBytes(byte[], CapabilityEnvelope[])
public void start()
XXX This blows...
public void logMessage(java.lang.String msg)
msg
- The message to append to the log.public void logMessage(int level, java.lang.String msg) throws java.lang.IllegalArgumentException
level
- A LogLevel value.msg
- The message to append to the log.java.lang.IllegalArgumentException
- if the level value is not one
specified in the LogLevel interface.public void logThrowable(java.lang.Throwable th)
th
- The exception to log.public void logThrowable(int level, java.lang.Throwable th) throws java.lang.IllegalArgumentException
level
- A LogLevel value.th
- The exception to log.java.lang.IllegalArgumentException
- If the level value is invalid.public edu.utah.janosvm.kit.comm.jsi.JSIHandler resolveSpecifier(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm, edu.utah.janosvm.kit.comm.jsi.JSIPair jp)
resolveSpecifier
in interface edu.utah.janosvm.kit.comm.jsi.JSIHandler
JSIHandler.resolveSpecifier(JSIMessage, JSIPair)
public void handleMessage(edu.utah.janosvm.kit.comm.jsi.JSIHandlerContext jhc, edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
handleMessage
in interface edu.utah.janosvm.kit.comm.jsi.JSIHandler
JSIHandler.handleMessage(JSIHandlerContext, JSIMessage)
public void getSuites(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
getSuites
in interface edu.utah.janosvm.kit.comm.jsi.JSIHandler
JSIHandler.getSuites(JSIMessage)
public java.lang.String toString()
toString
in class LoggerSpec
Object.toString()
|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |