jade.util
Class PerDayFileLogger

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.PrintStream
              extended by jade.util.PerDayFileLogger
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class PerDayFileLogger
extends java.io.PrintStream

This class is an OutputStream whose output is stored in in different files according to the day it is produced. Existing files, if any, are not rewritten as output is appended at the end of the file.

Author:
Giovanni Caire - TILab

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
PerDayFileLogger(java.lang.String file)
          Create a new day-based logger.
 
Method Summary
 void print(java.lang.Object obj)
          Print a Java object to the proper file, replacing the file every new day.
 void print(java.lang.String str)
          Print a string to the proper file, replacing the file every new day.
 void println()
          Print a new line to the proper file, replacing the file every new day.
 void println(java.lang.Object obj)
          Print a Java object and a newline to the proper file, replacing the file every new day.
 void println(java.lang.String str)
          Print a string and a new line to the proper file, replacing the file every new day.
 
Methods inherited from class java.io.PrintStream
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, setError, write, write
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerDayFileLogger

public PerDayFileLogger(java.lang.String file)
                 throws java.io.IOException
Create a new day-based logger.

Parameters:
file - The name of the file to write logs to.
Throws:
java.io.IOException - If some filesystem operation fails.
Method Detail

print

public void print(java.lang.Object obj)
Print a Java object to the proper file, replacing the file every new day.

Overrides:
print in class java.io.PrintStream
Parameters:
obj - The Java object to print.

print

public void print(java.lang.String str)
Print a string to the proper file, replacing the file every new day.

Overrides:
print in class java.io.PrintStream
Parameters:
str - The string to print.

println

public void println()
Print a new line to the proper file, replacing the file every new day.

Overrides:
println in class java.io.PrintStream

println

public void println(java.lang.Object obj)
Print a Java object and a newline to the proper file, replacing the file every new day.

Overrides:
println in class java.io.PrintStream
Parameters:
obj - The Java object to print.

println

public void println(java.lang.String str)
Print a string and a new line to the proper file, replacing the file every new day.

Overrides:
println in class java.io.PrintStream
Parameters:
str - THe string to print.