package log
- Alphabetic
- Public
- Protected
Type Members
- case class BasicLogMessage(level: Level = Info, message: String) extends LogMessage with Product with Serializable
Default implementation of a log message.
- class ConsoleOPALLogger extends OPALLogger
The console logger is a very basic logger that ignores the context.
- case class ExceptionLogMessage(level: Level = Info, category: Option[String] = None, baseMessage: String, t: Throwable) extends LogMessage with Product with Serializable
- sealed abstract class Level extends AnyRef
Common super trait of all log levels.
- trait LogContext extends AnyRef
A log context associates log messages with a specific context and logger.
A log context associates log messages with a specific context and logger. Using a log context facilitates the suppression of recurring message in a specific context and also makes it possible to direct messages to different targets. Before using a
LogContext
it has to be registered with the OPALLogger$.OPAL uses two primary log contexts:
- The GlobalLogContext$ which should be used for general log messages related to OPAL, such as the number of threads used for computations.
- The log context associated with org.opalj.br.analyses.Projects to log project related information (e.g., such as project related results or configuration issues.)
- Note
The registration of the
LogContext
with theOPALLogger
does not prevent the garbage collection of theLogContext
unless a logged message explicitly references its log context. This is – however – discouraged! If no message explicitly reference the log context it is then possible to unregister the log context in thefinalize
method that references the context.
- trait LogMessage extends AnyRef
Description of a log message.
Description of a log message.
Implementation Guidelines
A LogMessage should never contain a direct reference to a LogContext object.
- trait OPALLogger extends AnyRef
Facilitates the logging of messages that are relevant for the end user.
Facilitates the logging of messages that are relevant for the end user.
Usage
To use OPAL's logging facility use the companion object (OPALLogger$).
- Note
The OPALLogger framework is not intended to be used by developers to help debug analysis; it is intended to be used to inform (end)-users about the analysis progress.
- case class StandardLogContext extends LogContext with Product with Serializable
- case class StandardLogMessage(level: Level = Info, category: Option[String] = None, message: String) extends LogMessage with Product with Serializable
Default implementation of a log message.
Value Members
- object DevNullLogger extends OPALLogger
An instance of OPALLogger that does not perform _any logging_ .
An instance of OPALLogger that does not perform _any logging_ .
In general, it is HIGHLY recommended to use the
ConsoleOPALLogger
and to the set the minimium log level toError
. - case object Error extends Level with Product with Serializable
Factory for error level log messages.
Factory for error level log messages.
- See also
OPALLogger$ for usage instructions.
- case object Fatal extends Level with Product with Serializable
- case object GlobalLogContext extends LogContext with Product with Serializable
The global log context which should be used to log global messages.
The global log context which should be used to log global messages.
This context is automatically registered with the OPALLogger framework and uses, by default, a ConsoleOPALLogger.
- case object Info extends Level with Product with Serializable
Factory for info level log messages.
Factory for info level log messages.
- See also
OPALLogger$ for usage instructions.
- object LogMessage
- object OPALLogger extends OPALLogger
OPAL's logging facility.
OPAL's logging facility.
Usage
Basic
E.g., using the global context and the convenience methods.
implicit val logContext : LogContext = org.opalj.log.GlobalContext OPALLogger.info("project", "the project is garbage collected")
or
OPALLogger.info("project", "the project is garbage collected")(org.opalj.log.GlobalContext)
Advanced
Logging a message only once.
implicit val logContext : LogContext = org.opalj.log.GlobalContext OPALLogger.logOnce(Warn("project configuration", "the method cannot be resolved"))
Initialization
If the GlobalLogContext should not use the default ConsoleOPALLogger then the logger can be changed using
updateLogger
.Thread Safety
Thread safe.
- case object Warn extends Level with Product with Serializable
Factory for warn level log messages.
Factory for warn level log messages.
- See also
OPALLogger$ for usage instructions.