public class LogEveryDay
extends java.lang.Object
Constructor and Description |
---|
LogEveryDay(boolean enable,
LogSettings setting,
java.lang.String charset)
Initialize.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close record logs.
|
java.lang.String |
generateFileName()
Using the current date as file name to create a file(Not Thread-Safe).
|
java.lang.String |
getCurrentDate()
Get Year、Month、Day of Today(Not Thread-Safe).
|
LogRecord |
getLogRecord()
Returns instance of record logs.
|
void |
setLogEnable(boolean logEnable)
Enable log.
|
void |
setMaxFileSize(long space,
SpaceUnit unit)
Setting the limit size of Log file.
|
void |
write(java.lang.String str)
Write log into the Log file.
|
void |
writeln(java.lang.String str)
Will have text wraps automatically when write the log into file.
|
void |
writeln(java.lang.String tag,
java.lang.String message)
Will have text wraps automatically when write the log into file.
|
void |
writeln(java.lang.String tag,
java.lang.String message,
int index)
Will have text wraps automatically when write the log into file.
|
public LogEveryDay(boolean enable, LogSettings setting, java.lang.String charset)
enable
- enable of write log into Log filesetting
- settings of Log Objectcharset
- The Character encoding of Log filepublic void setLogEnable(boolean logEnable)
logEnable
- enablepublic java.lang.String getCurrentDate()
public java.lang.String generateFileName()
public void write(java.lang.String str)
str
- message which needs to be recordpublic void writeln(java.lang.String str)
str
- message which needs to be recordpublic void writeln(java.lang.String tag, java.lang.String message, int index)
tag
- The Tag Message to add in the headmessage
- message which needs to be recordindex
- index valuepublic void writeln(java.lang.String tag, java.lang.String message)
tag
- The Tag Message to add in the headmessage
- message which needs to be recordpublic void setMaxFileSize(long space, SpaceUnit unit)
space
- numbers in unitunit
- the unit of spacepublic LogRecord getLogRecord()
public void close()