Package de.uni_kiel.rz.fdr.repl
Class REPLLog
java.lang.Object
de.uni_kiel.rz.fdr.repl.REPLLog
This class provides the means for logging messages to various targets. If Log4J is available in the current VM,
it can also be used. cau-repl uses this class internally for its log messages, and you are encouraged to use it
from your Groovy code as well.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe different targets that log messages can be written to. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<REPLLog.LOG_TARGETS>The default log targets for your messages: Log4J with a fallback to the standard error output and additionally cau-repl's own log file.static final Set<REPLLog.LOG_TARGETS>The log targets for internal log messages originating from cau-repl itself.static booleanControls whether very fine-grained internal trace messages from cau-repl are logged.static booleanControls whether very fine-grained internal trace messages from cau-repl related to compilation are logged.static booleanControls whether very fine-grained internal trace messages from cau-repl related to methods during compilation are logged.static booleanControls whether very fine-grained internal trace messages from cau-repl related to dynamization are logged.static booleanControls whether very fine-grained internal trace messages from cau-repl related to jobs are logged. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic REPLLogEntryLog a new message with log levelDEBUGto the default log targets.static REPLLogEntryLog a new message with log levelERRORto the default log targets.static List<REPLLogEntry>getLog()Gets all log entries from the repl's internal log file (which is rotated when the JVM starts).static REPLLogEntryLog a new message with log levelINFOto the default log targets.static voidTry to (re-)initialize optional external libraries.static voidlog(REPLLogEntry entry) Log a given message to the default log targets.static voidlog(REPLLogEntry entry, Set<REPLLog.LOG_TARGETS> targets, PrintStream... streams) Log a given message.static REPLLogEntryLog a new message with log levelINFOto the default log targets.static REPLLogEntryLog a new message with log levelTRACEto the trace log targets.static REPLLogEntryLog a new message with log levelWARNto the default log targets.
-
Field Details
-
TRACE
public static boolean TRACEControls whether very fine-grained internal trace messages from cau-repl are logged. Do not enable in production. -
TRACE_COMPILE
public static boolean TRACE_COMPILEControls whether very fine-grained internal trace messages from cau-repl related to compilation are logged. EnablingTRACEoverrides this setting. -
TRACE_COMPILE_METHODS
public static boolean TRACE_COMPILE_METHODSControls whether very fine-grained internal trace messages from cau-repl related to methods during compilation are logged. EnablingTRACEoverrides this setting. -
TRACE_DYNAMIZE
public static boolean TRACE_DYNAMIZEControls whether very fine-grained internal trace messages from cau-repl related to dynamization are logged. EnablingTRACEoverrides this setting. Do not enable in production. -
TRACE_JOBS
public static boolean TRACE_JOBSControls whether very fine-grained internal trace messages from cau-repl related to jobs are logged. EnablingTRACEoverrides this setting. Do not enable in production. -
DEFAULT_LOG_TARGETS
The default log targets for your messages: Log4J with a fallback to the standard error output and additionally cau-repl's own log file. -
INTERNAL_LOG_TARGETS
The log targets for internal log messages originating from cau-repl itself.
-
-
Constructor Details
-
REPLLog
public REPLLog()
-
-
Method Details
-
trace
Log a new message with log levelTRACEto the trace log targets.- Parameters:
args- The log messages. You an use the "{}" placeholder in the first argument to format the succeeding arguments.- Returns:
- The log entry that was sent to the targets.
-
debug
Log a new message with log levelDEBUGto the default log targets.- Parameters:
args- The log messages. You an use the "{}" placeholder in the first argument to format the succeeding arguments.- Returns:
- The log entry that was sent to the targets.
-
info
Log a new message with log levelINFOto the default log targets.- Parameters:
args- The log messages. You an use the "{}" placeholder in the first argument to format the succeeding arguments.- Returns:
- The log entry that was sent to the targets.
-
warn
Log a new message with log levelWARNto the default log targets.- Parameters:
args- The log messages. You an use the "{}" placeholder in the first argument to format the succeeding arguments.- Returns:
- The log entry that was sent to the targets.
-
error
Log a new message with log levelERRORto the default log targets.- Parameters:
args- The log messages. You an use the "{}" placeholder in the first argument to format the succeeding arguments.- Returns:
- The log entry that was sent to the targets.
-
log
Log a new message with log levelINFOto the default log targets.- Parameters:
args- The log messages. You an use the "{}" placeholder in the first argument to format the succeeding arguments.- Returns:
- The log entry that was sent to the targets.
-
log
Log a given message to the default log targets.- Parameters:
entry- The message to log.
-
log
public static void log(REPLLogEntry entry, Set<REPLLog.LOG_TARGETS> targets, PrintStream... streams) Log a given message.- Parameters:
entry- The message to log.targets- The log targets to write to.streams- Additional Print Streams to write to.
-
getLog
Gets all log entries from the repl's internal log file (which is rotated when the JVM starts). They will be read from disk, so this call might be slow if the log file is big.- Returns:
- A list of all log entries from the repl's internal log file.
-
initializeLibs
public static void initializeLibs()Try to (re-)initialize optional external libraries. At the moment, this pertains only to Log4J. Invoking this method will check whether it is installed and make it available as a logging target.
-