Package jade.util
Class PerDayFileLogger
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.PrintStream
-
- jade.util.PerDayFileLogger
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class PerDayFileLogger extends 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
Constructors Constructor Description PerDayFileLogger(String file)Create a new day-based logger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprint(Object obj)Print a Java object to the proper file, replacing the file every new day.voidprint(String str)Print a string to the proper file, replacing the file every new day.voidprintln()Print a new line to the proper file, replacing the file every new day.voidprintln(Object obj)Print a Java object and a newline to the proper file, replacing the file every new day.voidprintln(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.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
PerDayFileLogger
public PerDayFileLogger(String file) throws IOException
Create a new day-based logger.- Parameters:
file- The name of the file to write logs to.- Throws:
IOException- If some filesystem operation fails.
-
-
Method Detail
-
print
public void print(Object obj)
Print a Java object to the proper file, replacing the file every new day.- Overrides:
printin classPrintStream- Parameters:
obj- The Java object to print.
-
print
public void print(String str)
Print a string to the proper file, replacing the file every new day.- Overrides:
printin classPrintStream- 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:
printlnin classPrintStream
-
println
public void println(Object obj)
Print a Java object and a newline to the proper file, replacing the file every new day.- Overrides:
printlnin classPrintStream- Parameters:
obj- The Java object to print.
-
println
public void println(String str)
Print a string and a new line to the proper file, replacing the file every new day.- Overrides:
printlnin classPrintStream- Parameters:
str- THe string to print.
-
-