PenProfile 2.x

com.livescribe.ext.util
Class Log

java.lang.Object
  extended by com.livescribe.ext.util.Log

public final class Log
extends Object

A convenience class that provides access to the penlet's Logger instance. It is designed as a set of static methods so that a Logger instance does not need to be passed around between classes that wish to use the log.

In addition to the set of debug/info/warn/error/test outputs, the "out" methods provide access to System.out. Also, a set of "tracing" methods provide nicely formatted debug output containing the class name and method name. Note, however, that the class name may be obfuscated in certain projects.

Note that the Logger instance must be set via setLogger(Logger) before any of its methods can be used.

See Also:
Logger

Method Summary
static void debug(Class clss, String method, String msg)
          Writes a debug message to the log and prefixes the message with "SimpleClassName.method: ".
static void debug(String msg)
          Writes an debug message to the log.
static void debug(String className, String method, String msg)
          Writes a debug message to the log and prefixes the message with "SimpleClassName.method: ".
static void error(Class clss, String method, String msg)
          Writes an error to the log and prefixes the message with "SimpleClassName.method: ".
static void error(String msg)
          Writes an error message to the log.
static void error(String className, String method, String msg)
          Writes an error to the log and prefixes the message with "SimpleClassName.method: ".
static void info(Class clss, String method, String msg)
          Writes an info message to the log and prefixes the message with "SimpleClassName.method: ".
static void info(String msg)
          Writes an info message to the log.
static void info(String className, String method, String msg)
          Writes an info message to the log and prefixes the message with "SimpleClassName.method: ".
static void out(Class clss, String method, String msg)
          Sends the output to System.out.
static void out(String msg)
          Sends the output to System.out.
static void out(String className, String method, String msg)
          Sends the output to System.out.
static void setLogger(Logger logger)
          Sets the current logger.
static void test(Class clss, String method, String msg)
          Writes a test message to the log and prefixes the message with "SimpleClassName.method: ".
static void test(String msg)
          Writes an test message to the log.
static void test(String className, String method, String msg)
          Writes a test message to the log and prefixes the message with "SimpleClassName.method: ".
static void warn(Class clss, String method, String msg)
          Writes a warning to the log and prefixes the message with "SimpleClassName.method: ".
static void warn(String msg)
          Writes an warn message to the log.
static void warn(String className, String method, String msg)
          Writes a warning to the log and prefixes the message with "SimpleClassName.method: ".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLogger

public static void setLogger(Logger logger)
Sets the current logger. The logger can be set to null.

Parameters:
logger - the new Logger instance, or null to unset it.

debug

public static void debug(String msg)
Writes an debug message to the log.

Parameters:
msg - write this message

info

public static void info(String msg)
Writes an info message to the log.

Parameters:
msg - write this message

warn

public static void warn(String msg)
Writes an warn message to the log.

Parameters:
msg - write this message

error

public static void error(String msg)
Writes an error message to the log.

Parameters:
msg - write this message

test

public static void test(String msg)
Writes an test message to the log.

Parameters:
msg - write this message

out

public static void out(String msg)
Sends the output to System.out.

Parameters:
msg - the message

out

public static void out(Class clss,
                       String method,
                       String msg)
Sends the output to System.out.

Parameters:
clss - the class
method - the method name
msg - the message

out

public static void out(String className,
                       String method,
                       String msg)
Sends the output to System.out.

Parameters:
className - the class name
method - the method name
msg - the message

debug

public static void debug(Class clss,
                         String method,
                         String msg)
Writes a debug message to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
clss - the class
method - the method name
msg - the debug message

debug

public static void debug(String className,
                         String method,
                         String msg)
Writes a debug message to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
className - the class name
method - the method name
msg - the debug message

info

public static void info(Class clss,
                        String method,
                        String msg)
Writes an info message to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
clss - the class
method - the method name
msg - the info message

info

public static void info(String className,
                        String method,
                        String msg)
Writes an info message to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
className - the class name
method - the method name
msg - the info message

warn

public static void warn(Class clss,
                        String method,
                        String msg)
Writes a warning to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
clss - the class
method - the method name
msg - the warning message

warn

public static void warn(String className,
                        String method,
                        String msg)
Writes a warning to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
className - the class name
method - the method name
msg - the warning message

error

public static void error(Class clss,
                         String method,
                         String msg)
Writes an error to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
clss - the class
method - the method name
msg - the error message

error

public static void error(String className,
                         String method,
                         String msg)
Writes an error to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
className - the class name
method - the method name
msg - the error message

test

public static void test(Class clss,
                        String method,
                        String msg)
Writes a test message to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
clss - the class
method - the method name
msg - the test message

test

public static void test(String className,
                        String method,
                        String msg)
Writes a test message to the log and prefixes the message with "SimpleClassName.method: ".

Parameters:
className - the class name
method - the method name
msg - the test message

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.