Package adaptlil
Class SimpleLogger
java.lang.Object
adaptlil.SimpleLogger
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the current date and time formatted to yyyy-mm-dd hh:mm:ssvoid
Log the string into this SimpleLogger's output file.void
printAndLog
(String line) Prepends timestamp and print line to System.out and log the line in this SimpleLogger's file.void
printAndLog
(String line, boolean disablePrependedTimestamp) Print line to System.out and log the line in this SimpleLogger's file w/ option to disable prependTimestamp.private void
printAndLog
(String line, PrintStream outStream, boolean disablePrependTimestamp) Prints w/ timestamp prepended
-
Field Details
-
outputfile
-
outputWriter
-
-
Constructor Details
-
SimpleLogger
SimpleLogger is used to write logs to a file.- Parameters:
outputFile
-
-
-
Method Details
-
logLine
Log the string into this SimpleLogger's output file.- Parameters:
line
-
-
printAndLog
Print line to System.out and log the line in this SimpleLogger's file w/ option to disable prependTimestamp.- Parameters:
line
-
-
printAndLog
Prepends timestamp and print line to System.out and log the line in this SimpleLogger's file.- Parameters:
line
-
-
printAndLog
Prints w/ timestamp prepended- Parameters:
line
- String to output to the stream and to log in SimpleLogger's log fileoutStream
- Specify Printstream to output line to
-
getDateTimeStamp
Return the current date and time formatted to yyyy-mm-dd hh:mm:ss- Returns:
-