|
SoftNet-Consult Java Utility Library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.softnetConsult.utils.log.ScreenFileLoggerFactory
public final class ScreenFileLoggerFactory
This class provides a number of convenience methods for creating ScreenFileLogger
objects.
This product includes software developed by the
SoftNet-Consult Java Utility Library project and its contributors.
(http://java-tools.sourceforge.net)
Copyright (c) 2007-2008 SoftNet-Consult.
Copyright (c) 2007-2008 G. Paperin.
All rights reserved.
File: ScreenFileLoggerFactory.java
Library API version: "2.02"
Java compliance version: "1.5"
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following terms and conditions are met:
1. Redistributions of source code must retain the above
acknowledgement of the SoftNet-Consult Java Utility Library project, the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above acknowledgement of the
SoftNet-Consult Java Utility Library project, the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
3. All advertising materials mentioning features or use of this software or any derived
software must display the following acknowledgement:
This product includes software developed by the SoftNet-Consult Java Utility Library
project and its contributors.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Field Summary | |
---|---|
private static int |
defaultIndentationLen
Default indentation length in characters. |
private static java.lang.String |
defaultLogfileExt
Default file extension for log files. |
private static java.lang.String |
defaultLogfileName
Default base name for log files. |
Constructor Summary | |
---|---|
private |
ScreenFileLoggerFactory()
Prevents instances of this class from being created as this class contains only static utility methods. |
Method Summary | |
---|---|
static ScreenFileLogger |
createLogger()
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(char[] indentationStr)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.io.File logFile)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.io.File logFile,
boolean append)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.io.File logFile,
boolean append,
int indentLen)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.io.File logFile,
int indentLen)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logPath)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logPath,
boolean append)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logPath,
boolean append,
int indentLen)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logPath,
int indentLen)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logDir,
java.lang.String logName)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logDir,
java.lang.String logName,
boolean append)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logDir,
java.lang.String logName,
boolean append,
int indentLen)
Creates a new logger that logs to screen only. |
static ScreenFileLogger |
createLogger(java.lang.String logDir,
java.lang.String logName,
int indentLen)
Creates a new logger that logs to screen only. |
static java.lang.String |
getIndentStr(int len)
Constructs an indentation string of the required length. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int defaultIndentationLen
private static final java.lang.String defaultLogfileName
private static final java.lang.String defaultLogfileExt
Constructor Detail |
---|
private ScreenFileLoggerFactory()
Method Detail |
---|
public static java.lang.String getIndentStr(int len)
len
- Length of the indentation string.
len
white spaces.public static ScreenFileLogger createLogger()
logToScreen
: on.logToFile
: off.logFile
: null.append
: no, overwrite.indentation
: a string consisting of defaultIndentationLen
white spaces.
public static ScreenFileLogger createLogger(char[] indentationStr)
logToScreen
: on.logToFile
: off.logFile
: null.append
: no, overwrite.indentation
: a string consisting of defaultIndentationLen
white spaces.
indentationStr
- A string to use for indentation (one copy per indent-level), it does
not necessarily need to consist of white spaces.
public static ScreenFileLogger createLogger(java.lang.String logPath, boolean append, int indentLen)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: as specified.indentation
: a string consisting of the specified number of white spaces.
logPath
- The file for logging. If null
, a unique default file will be
created in the program start directory.append
- Whether to append (or overwrite) the log file.indentLen
- The length of the indentation string.
public static ScreenFileLogger createLogger(java.lang.String logDir, java.lang.String logName, boolean append, int indentLen)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: as specified.indentation
: a string consisting of the specified number of white spaces.
logDir
- The directory for for log file. If null
, the program start
directory will be used.logName
- The file for logging (relative to the specified directory). If null
,
a unique default file will be created in the specified directory.append
- Whether to append (or overwrite) the log file.indentLen
- The length of the indentation string.
public static ScreenFileLogger createLogger(java.io.File logFile, boolean append, int indentLen)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: as specified.indentation
: a string consisting of the specified number of white spaces.
logFile
- The file for logging. If null
, a unique default file will be
created in the program start directory. If the file specified a directory, a unique
default file will be created within that directory.append
- Whether to append (or overwrite) the log file.indentLen
- The length of the indentation string.
public static ScreenFileLogger createLogger(java.lang.String logPath)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: yes.indentation
: a string consisting of defaultIndentationLen
white spaces.
logPath
- The file for logging. If null
, a unique default file will be
created in the program start directory.
public static ScreenFileLogger createLogger(java.lang.String logDir, java.lang.String logName)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: yes.indentation
: a string consisting of defaultIndentationLen
white spaces.
logDir
- The directory for for log file. If null
, the program start
directory will be used.logName
- The file for logging (relative to the specified directory). If null
,
a unique default file will be created in the specified directory.
public static ScreenFileLogger createLogger(java.io.File logFile)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: yes.indentation
: a string consisting of defaultIndentationLen
white spaces.
logFile
- The file for logging. If null
, a unique default file will be
created in the program start directory. If the file specified a directory, a unique
default file will be created within that directory.
public static ScreenFileLogger createLogger(java.lang.String logPath, boolean append)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: as specified.indentation
: a string consisting of defaultIndentationLen
white spaces.
logPath
- The file for logging. If null
, a unique default file will be
created in the program start directory.append
- Whether to append (or overwrite) the log file.
public static ScreenFileLogger createLogger(java.lang.String logDir, java.lang.String logName, boolean append)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: as specified.indentation
: a string consisting of defaultIndentationLen
white spaces.
logDir
- The directory for for log file. If null
, the program start
directory will be used.logName
- The file for logging (relative to the specified directory). If null
,
a unique default file will be created in the specified directory.append
- Whether to append (or overwrite) the log file.
public static ScreenFileLogger createLogger(java.io.File logFile, boolean append)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: as specified.indentation
: a string consisting of defaultIndentationLen
white spaces.
logFile
- The file for logging. If null
, a unique default file will be
created in the program start directory. If the file specified a directory, a unique
default file will be created within that directory.append
- Whether to append (or overwrite) the log file.
public static ScreenFileLogger createLogger(java.lang.String logPath, int indentLen)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: yes.indentation
: a string consisting of the specified number of white spaces.
logPath
- The file for logging. If null
, a unique default file will be
created in the program start directory.indentLen
- The length of the indentation string.
public static ScreenFileLogger createLogger(java.lang.String logDir, java.lang.String logName, int indentLen)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: yes.indentation
: a string consisting of the specified number of white spaces.
logDir
- The directory for for log file. If null
, the program start
directory will be used.logName
- The file for logging (relative to the specified directory). If null
,
a unique default file will be created in the specified directory.indentLen
- The length of the indentation string.
public static ScreenFileLogger createLogger(java.io.File logFile, int indentLen)
logToScreen
: on.logToFile
: on.logFile
: as specified.append
: yes.indentation
: a string consisting of the specified number of white spaces.
logFile
- The file for logging. If null
, a unique default file will be
created in the program start directory. If the file specified a directory, a unique
default file will be created within that directory.indentLen
- The length of the indentation string.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |