Merge pull request #705 from rcordovano/log_per_case

Apply NetBeans IDE formatting to Logger class
This commit is contained in:
Richard Cordovano 2014-05-07 11:09:49 -04:00
commit 1968c08b3b

View File

@ -24,10 +24,11 @@ import java.util.logging.*;
/** /**
* Custom Autopsy logger wrapper over java.util.logging.Logger with default file * Custom Autopsy logger wrapper over java.util.logging.Logger with default file
* streams logging to autopsy.log (general high level messages), * streams logging to autopsy.log (general high level messages),
* autopsy_traces.log (also including exception traces). * autopsy_traces.log (also including exception traces). In development build,
* In development build, those are also redirected to console / messages log. * those are also redirected to console / messages log.
* *
* Contains a utility method to log user actions to autopsy_actions.log via noteAction() * Contains a utility method to log user actions to autopsy_actions.log via
* noteAction()
* *
* Use like java.util.logging.Logger API, get a * Use like java.util.logging.Logger API, get a
* org.sleuthkit.autopsy.coreutils.Logger handle using factory method * org.sleuthkit.autopsy.coreutils.Logger handle using factory method
@ -43,14 +44,11 @@ public class Logger extends java.util.logging.Logger {
private static final String LOG_DIR = PlatformUtil.getLogDirectory(); private static final String LOG_DIR = PlatformUtil.getLogDirectory();
static final int LOG_SIZE = 0; // in bytes, zero is unlimited static final int LOG_SIZE = 0; // in bytes, zero is unlimited
static final int LOG_FILE_COUNT = 10; static final int LOG_FILE_COUNT = 10;
//File Handlers which point to the output logs //File Handlers which point to the output logs
private static final FileHandler traces = initTraces(); private static final FileHandler traces = initTraces();
private static final FileHandler normal = initNormal(); private static final FileHandler normal = initNormal();
private static final Handler console = new java.util.logging.ConsoleHandler(); private static final Handler console = new java.util.logging.ConsoleHandler();
private static final java.util.logging.Logger actionsLogger = initActionsLogger(); private static final java.util.logging.Logger actionsLogger = initActionsLogger();
/** /**
* Main messages log file name * Main messages log file name
*/ */
@ -59,7 +57,6 @@ public class Logger extends java.util.logging.Logger {
* Detailed exception trace log file name * Detailed exception trace log file name
*/ */
public static final String tracesLog = "autopsy_traces.log"; //NON-NLS public static final String tracesLog = "autopsy_traces.log"; //NON-NLS
/** /**
* Action logger file name * Action logger file name
*/ */
@ -68,7 +65,7 @@ public class Logger extends java.util.logging.Logger {
/** /**
* Static blocks to get around compile errors such as "variable might not * Static blocks to get around compile errors such as "variable might not
* have been initialized * have been initialized
* *
*/ */
//<editor-fold defaultstate="visible" desc="static block initializers"> //<editor-fold defaultstate="visible" desc="static block initializers">
private static FileHandler initTraces() { private static FileHandler initTraces() {
@ -125,6 +122,7 @@ public class Logger extends java.util.logging.Logger {
/** /**
* Log an action to autopsy_actions.log * Log an action to autopsy_actions.log
*
* @param actionClass class where user triggered action occurs * @param actionClass class where user triggered action occurs
*/ */
public static void noteAction(Class<?> actionClass) { public static void noteAction(Class<?> actionClass) {