|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.utils.LogUtils
public class LogUtils
This class contains static utility methods for writing files when a log is set to debug.
Constructor Summary | |
---|---|
LogUtils()
|
Method Summary | |
---|---|
static String |
createDurationTimeString(String message,
long startTime,
boolean roundToMinutes)
Create a string as follows: ${message} + took: ... |
static String |
createTimeString(String message,
long startTime,
long endTime,
boolean roundToMinutes)
Create a string as follows: ${message} + took: ... |
static void |
writeBinaryFile(org.slf4j.Logger log,
File file,
byte[] data)
Writes the given binary data to the specified file, if the log level is set to debug. |
static void |
writeBinaryTempFile(org.slf4j.Logger log,
String filePrefix,
String fileSuffix,
byte[] data)
Writes the given binary data to a temporary file (created from specified prefix and suffix), if the log level is set to debug. |
static void |
writeFile(org.slf4j.Logger log,
File file,
String content)
Writes the given String to the specified file, if the log level is set to debug |
static void |
writeTempFile(org.slf4j.Logger log,
String filePrefix,
String fileSuffix,
String content)
Writes the given String to a temporary file (created from specified prefix and suffix), if the log level
is set to debug. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogUtils()
Method Detail |
---|
public static void writeFile(org.slf4j.Logger log, File file, String content)
String
to the specified file, if the log level is set to debug. *
log
- the log to check for the log levelfile
- file to write tocontent
- public static void writeTempFile(org.slf4j.Logger log, String filePrefix, String fileSuffix, String content)
String
to a temporary file (created from specified prefix and suffix), if the log level
is set to debug.
log
- the log to check for the log levelfilePrefix
- prefix for the temp file name, must be at least three characters longfileSuffix
- suffix for the temp file name, can be null (then ".tmp" is used)content
- *
public static void writeBinaryFile(org.slf4j.Logger log, File file, byte[] data)
log
- the log to check for the log levelfile
- file to write todata
- binary data to be writtenpublic static void writeBinaryTempFile(org.slf4j.Logger log, String filePrefix, String fileSuffix, byte[] data)
log
- the log to check for the log levelfilePrefix
- prefix for the temp file name, must be at least three characters longfileSuffix
- suffix for the temp file name, can be null (then ".tmp" is used)data
- binary data to be written*
public static String createDurationTimeString(String message, long startTime, boolean roundToMinutes)
message
- to start withstartTime
- roundToMinutes
- if true the second| minutes syntax will be used, if falls only ms will be appended.
public static String createTimeString(String message, long startTime, long endTime, boolean roundToMinutes)
message
- to start withstartTime
- endTime
- roundToMinutes
- if true the second| minutes syntax will be used, if falls only ms will be appended.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |