object OPALLogger extends OPALLogger
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.
- Source
- OPALLogger.scala
- Alphabetic
- By Inheritance
- OPALLogger
- OPALLogger
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def debug(p: => Boolean, category: String, message: => String)(implicit ctx: LogContext): Unit
Debug message are only included in the code if assertions are turned on and the predicate
p
evaluates totrue
.Debug message are only included in the code if assertions are turned on and the predicate
p
evaluates totrue
. If debug message are logged, then they are logged as Info-level messages.- Annotations
- @elidable()
- final def debug(category: String, message: String)(implicit ctx: LogContext): Unit
Debug message are only included in the code if assertions are turned on.
Debug message are only included in the code if assertions are turned on. If debug message are logged, then they are logged as Info-level messages.
- Annotations
- @elidable()
- final def error(category: String, message: String, t: Throwable)(implicit ctx: LogContext): Unit
Log an error message.
Log an error message. Error message should either be related to internal errors or to project configurations that are so badly broken that a meaningful analysis is not possible.
This method is primarily a convenience method that creates an Error message which is the logged.
- final def error(category: String, message: String)(implicit ctx: LogContext): Unit
Log an error message.
Log an error message. Error message should either be related to internal errors or to project configurations that are so badly broken that a meaningful analysis is not possible.
This method is primarily a convenience method that creates an Error message which is the logged.
- def globalLogger(): OPALLogger
- final def info(category: String, message: String)(implicit ctx: LogContext): Unit
Log some general information.
Log some general information. General information may be related, e.g., to the overall progress of the analysis, the results of an analysis, the major configuration settings.
This method is primarily a convenience method that creates an Info message which is the logged.
- Note
Do not use this method if the analysis may create the same message multiple times. In this case use logOnce.
- def isUnregistered(ctx: LogContext): Boolean
- def log(message: LogMessage)(implicit ctx: LogContext): Unit
The given message is logged.
The given message is logged.
- Definition Classes
- OPALLogger → OPALLogger
- final def logOnce(message: LogMessage)(implicit ctx: LogContext): Unit
The given message is only logged once.
The given message is only logged once. This is particularly useful if an analysis may hit a specific problem multiple times, but it is sufficient/meaningful to log it only once.
This method should not be used if the message may only be generated at most once. The respective message will be cached in the log context.
- Definition Classes
- OPALLogger
- def logger(ctx: LogContext): OPALLogger
- final def progress(message: String)(implicit ctx: LogContext): Unit
Logs a message in the category "
progress
". - def register(ctx: LogContext, logger: OPALLogger = new ConsoleOPALLogger(true)): Unit
Registers the given context with the OPAL logging facility and associates the specified logger with the context.
- def unregister(ctx: LogContext): Unit
- def updateLogger(ctx: LogContext, logger: OPALLogger): Unit
- final def warn(category: String, message: String)(implicit ctx: LogContext): Unit
Log a warning.
Log a warning. Warnings are typically related to incomplete project configurations that may affect the overall precision of the analysis, but which are not rendering the analysis meaningless.
This method is primarily a convenience method that creates an Warn message which is the logged.
- Note
Do not use this method if the analysis may create the same message multiple times. In this case use logOnce.