org.eclipse.ocl.examples.debug.vm.utils
Class WriterLog

java.lang.Object
  extended by org.eclipse.ocl.examples.debug.vm.utils.WriterLog
All Implemented Interfaces:
Log

public class WriterLog
extends java.lang.Object
implements Log

A basic logger backed-up with Writer.

Since:
2.0
Author:
dvorak
Noextend:
This class is not intended to be subclassed by clients.

Field Summary
protected  VMDebugCore debugCore
           
 
Fields inherited from interface org.eclipse.ocl.examples.debug.vm.utils.Log
NULL_LOG
 
Constructor Summary
WriterLog(VMDebugCore debugCore, java.io.Writer writer, boolean flush)
          Constructs a log for the given writer object.
 
Method Summary
protected  java.io.Writer getWriter()
           
 void log(int level, java.lang.String message)
          Logs a message at the specified logging level.
 void log(int level, java.lang.String message, java.lang.Object param)
          Logs a message with additional parameter at the specified logging level.
 void log(java.lang.String message)
          Logs a message.
 void log(java.lang.String message, java.lang.Object param)
          Logs a message with additional parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugCore

@NonNull
protected final VMDebugCore debugCore
Constructor Detail

WriterLog

public WriterLog(@NonNull
                 VMDebugCore debugCore,
                 @NonNull
                 java.io.Writer writer,
                 boolean flush)
Constructs a log for the given writer object.

Parameters:
debugCore -
writer - the writer object to receive the log record data
flush - if true, the writer gets flushed with every record logged. If set to false, the flushing behavior is dependent on the writer implementation used
Throws:
java.lang.IllegalArgumentException - if the passed writer is null
Since:
3.0
Method Detail

getWriter

protected final java.io.Writer getWriter()

log

public void log(int level,
                java.lang.String message,
                java.lang.Object param)
Description copied from interface: Log
Logs a message with additional parameter at the specified logging level.

Specified by:
log in interface Log
Parameters:
level - the level value to which the resulting log record should apply
message - the textual message to be logged
param - the parameter object to the message

log

public void log(int level,
                java.lang.String message)
Description copied from interface: Log
Logs a message at the specified logging level.

Specified by:
log in interface Log
Parameters:
level - the level value to which the resulting log record should apply
message - the textual message to be logged

log

public void log(java.lang.String message,
                java.lang.Object param)
Description copied from interface: Log
Logs a message with additional parameter.

Specified by:
log in interface Log
Parameters:
message - the textual message to be logged
param - the parameter object to the message

log

public void log(java.lang.String message)
Description copied from interface: Log
Logs a message.

Specified by:
log in interface Log
Parameters:
message - the textual message to be logged