public class FileNotifiable extends java.lang.Object implements Notifiable
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log
Used for logging.
|
LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARN, STR_LEVEL_DEBUG, STR_LEVEL_ERROR, STR_LEVEL_INFO, STR_LEVEL_WARN
Constructor and Description |
---|
FileNotifiable(java.lang.String fileName,
java.lang.String characterSet)
Constructs a DefaultScrapingSessionNotifiable to be used with the named file.
|
Modifier and Type | Method and Description |
---|---|
void |
closeLog()
Closes the log file.
|
java.lang.String |
getLogFileName()
Gets the name of the log file being written to.
|
int |
getLoggingLevel()
Gets the current logging level.
|
void |
log(java.lang.String message)
Logs a DEBUG message to the log.
|
void |
logDebug(java.lang.String message)
Logs a message with LEVEL_DEBUG.
|
void |
logError(java.lang.String message)
Logs a message with LEVEL_ERROR.
|
void |
logInfo(java.lang.String message)
Logs a message with LEVEL_INFO.
|
void |
logWarn(java.lang.String message)
Logs a message with LEVEL_WARN.
|
void |
setLogFile(java.io.File logFile)
Sets the log file being written to.
|
void |
setLoggingLevel(int loggingLevel)
Sets the current logging level.
|
void |
writeLogLine(java.lang.String message)
Logs a message.
|
public FileNotifiable(java.lang.String fileName, java.lang.String characterSet)
fileName
- The name of the File
.characterSet
- The character set to use for the log file.public void writeLogLine(java.lang.String message)
message
- The message to be logged.public void closeLog()
public void setLogFile(java.io.File logFile)
logFile
- The log file.@Nullable public java.lang.String getLogFileName()
public int getLoggingLevel()
getLoggingLevel
in interface Notifiable
public void setLoggingLevel(int loggingLevel)
setLoggingLevel
in interface Notifiable
loggingLevel
- The logging level, as defined by one of the "LOGGING" constants.public void log(java.lang.String message)
log
in interface Notifiable
message
- The message to log.public void logDebug(java.lang.String message)
logDebug
in interface Notifiable
message
- The message to be logged.public void logInfo(java.lang.String message)
logInfo
in interface Notifiable
message
- The message to be logged.public void logWarn(java.lang.String message)
logWarn
in interface Notifiable
message
- The message to be logged.public void logError(java.lang.String message)
logError
in interface Notifiable
message
- The message to be logged.