Package com.biglybt.core.logging.impl
Class FileLogging
- java.lang.Object
-
- com.biglybt.core.logging.impl.FileLogging
-
- All Implemented Interfaces:
ILogEventListener
public class FileLogging extends java.lang.Object implements ILogEventListener
Log events to a file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BAK_FILE_NAME
private boolean
bLogToFile
private boolean
bLogToFileErrorPrinted
private static java.lang.String
CFG_ENABLELOGTOFILE
private static boolean
closing
private static boolean
closing_taking_too_long
static LogIDs[]
configurableLOGIDs
private static int
DEFPADDING
private java.text.SimpleDateFormat
format
private java.util.ArrayList[]
ignoredComponents
private int
iLogFileMaxMB
private int
lastWidth
private java.util.ArrayList
listeners
static java.lang.String
LOG_FILE_NAME
private java.io.FileOutputStream
logFileOS
private java.io.PrintWriter
logFilePrinter
private java.lang.String
sLogDir
-
Constructor Summary
Constructors Constructor Description FileLogging()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(FileLoggingAdapter listener)
private void
checkAndSwapLog()
(package private) void
checkLoggingConfig()
java.util.List
getListeners()
private int
indexToLogType(int index)
void
initialize()
void
log(LogEvent event)
A LogEvent has been generated.private void
logToFile(java.lang.String str)
private int
logTypeToIndex(int entryType)
private int
padAndAppend(java.lang.StringBuffer appendTo, java.lang.String s, int width, int growBy)
protected void
reloadLogToFileParam()
void
removeListener(FileLoggingAdapter listener)
protected static void
setClosing()
void
setClosingTakingTooLong()
-
-
-
Field Detail
-
LOG_FILE_NAME
public static final java.lang.String LOG_FILE_NAME
- See Also:
- Constant Field Values
-
BAK_FILE_NAME
public static final java.lang.String BAK_FILE_NAME
- See Also:
- Constant Field Values
-
configurableLOGIDs
public static final LogIDs[] configurableLOGIDs
-
CFG_ENABLELOGTOFILE
private static final java.lang.String CFG_ENABLELOGTOFILE
- See Also:
- Constant Field Values
-
closing
private static boolean closing
-
closing_taking_too_long
private static volatile boolean closing_taking_too_long
-
bLogToFile
private boolean bLogToFile
-
bLogToFileErrorPrinted
private boolean bLogToFileErrorPrinted
-
sLogDir
private java.lang.String sLogDir
-
iLogFileMaxMB
private int iLogFileMaxMB
-
ignoredComponents
private final java.util.ArrayList[] ignoredComponents
-
listeners
private final java.util.ArrayList listeners
-
format
private java.text.SimpleDateFormat format
-
logFileOS
private java.io.FileOutputStream logFileOS
-
logFilePrinter
private java.io.PrintWriter logFilePrinter
-
DEFPADDING
private static final int DEFPADDING
- See Also:
- Constant Field Values
-
lastWidth
private int lastWidth
-
-
Method Detail
-
setClosing
protected static void setClosing()
-
setClosingTakingTooLong
public void setClosingTakingTooLong()
-
initialize
public void initialize()
-
reloadLogToFileParam
protected void reloadLogToFileParam()
-
checkLoggingConfig
void checkLoggingConfig()
-
logToFile
private void logToFile(java.lang.String str)
-
checkAndSwapLog
private void checkAndSwapLog()
-
logTypeToIndex
private int logTypeToIndex(int entryType)
-
indexToLogType
private int indexToLogType(int index)
-
log
public void log(LogEvent event)
Description copied from interface:ILogEventListener
A LogEvent has been generated.- Specified by:
log
in interfaceILogEventListener
- Parameters:
event
- The newly generated LogEvent
-
padAndAppend
private int padAndAppend(java.lang.StringBuffer appendTo, java.lang.String s, int width, int growBy)
-
addListener
public void addListener(FileLoggingAdapter listener)
-
removeListener
public void removeListener(FileLoggingAdapter listener)
-
getListeners
public java.util.List getListeners()
-
-