PrintLogger

public class PrintLogger extends Object

A class which configures logger to print a log message to the console.

Constructors

Name Description
public PrintLogger()

Methods

setGlobalJacquardSDKLogger

public static void setGlobalJacquardSDKLogger(Logger logger)

Sets the globalLoggerinstance used by all code in Jacquard SDK.

You do not need to set this - the default logger prints log messages to the console usingLog#println(int, String, String), ignoringLogLevelLogLevel. You can also set a default logger with log level which you desire, or you may implement your own customLoggertype.

Parameters

Name Description
Logger logger

new Loggerinstance

ReturnValue

Name Description
void

initialize

public static void initialize( logLevels, Context context)

Initializes a default loggerLoggerwith a log level which you desire.

You can also usePrintLoggerwith a default log levels.

Parameters

Name Description
logLevels

which log levels LogLevelshould be displayed

Context context

ReturnValue

Name Description
void

initialize

public static void initialize(Context context)

Initializes a default logger with a log levelLogLevel,LogLevel,LogLevel,LogLevel.

You can also set a log level which you desirePrintLogger.

Parameters

Name Description
Context context

ReturnValue

Name Description
void

ignore

public static void ignore(String text)

Ignores the logs containing the provided text.

Parameters

Name Description
String text

the string to filter the logs.

ReturnValue

Name Description
void

v

public static void v(String tag, String message)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

ReturnValue

Name Description
void

v

public static void v(String tag, String message, Throwable t)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

Throwable t

an exception to log

ReturnValue

Name Description
void

d

public static void d(String tag, String message)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

ReturnValue

Name Description
void

d

public static void d(String tag, String message, Throwable t)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

Throwable t

an exception to log

ReturnValue

Name Description
void

i

public static void i(String tag, String message)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

ReturnValue

Name Description
void

i

public static void i(String tag, String message, Throwable t)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

Throwable t

an exception to log

ReturnValue

Name Description
void

w

public static void w(String tag, String message)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

ReturnValue

Name Description
void

w

public static void w(String tag, String message, Throwable t)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

Throwable t

an exception to log

ReturnValue

Name Description
void

e

public static void e(String tag, String message)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

ReturnValue

Name Description
void

e

public static void e(String tag, String message, Throwable t)

Sends aLogLevellog message.

Parameters

Name Description
String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

Throwable t

an exception to log

ReturnValue

Name Description
void

log

public static void log(LogLevel logLevel, String tag, String message)

Sends a log message.

Parameters

Name Description
LogLevel logLevel

priority level of the message

String tag

the source of a log message, the class or activity where the log call occurs

String message

the message you would like logged

ReturnValue

Name Description
void

getLogFile

public static File getLogFile(Context context)

Returns a log file.

Parameters

Name Description
Context context

application context from a caller app.

ReturnValue

Name Description
File