net.percederberg.mibble
Class SimpleLogPrinter

java.lang.Object
  extended bynet.percederberg.mibble.SimpleLogPrinter
All Implemented Interfaces:
LogPrinter

public class SimpleLogPrinter
extends java.lang.Object
implements LogPrinter

A simple log printer. This class formats and prints log entries to an output stream. The formatting includes linebreaking the string so that a specified print margin is not passed unless necessary.

Since:
2.0

Constructor Summary
SimpleLogPrinter(java.io.PrintStream output, int margin)
          Creates a new simple log printer.
SimpleLogPrinter(java.io.PrintWriter output, int margin)
          Creates a new simple log printer.
 
Method Summary
 void print(LogEntry entry)
          Prints a log entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLogPrinter

public SimpleLogPrinter(java.io.PrintStream output,
                        int margin)
Creates a new simple log printer.

Parameters:
output - the output stream
margin - the print margin

SimpleLogPrinter

public SimpleLogPrinter(java.io.PrintWriter output,
                        int margin)
Creates a new simple log printer.

Parameters:
output - the output stream
margin - the print margin
Method Detail

print

public void print(LogEntry entry)
Prints a log entry.

Specified by:
print in interface LogPrinter
Parameters:
entry - the log entry to print