package log
- Alphabetic
- Public
- All
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
LogContextit 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
LogContextwith theOPALLoggerdoes not prevent the garbage collection of theLogContextunless 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 thefinalizemethod 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
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.
- object Fatal extends Level with Product with Serializable
-
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.
-
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
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 = 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 = 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.
-
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.