public class Debug extends Object
Constructor and Description |
---|
Debug() |
Modifier and Type | Method and Description |
---|---|
static void |
action(String message,
Object... args)
Sikuli messages from actions like click, ...
switch on/off: Settings.ActionLogs |
long |
end()
stop timer and print timer message
log output depends on Settings.ProfileLogs |
static void |
enter(String message,
Object... args)
profile convenience: entering a method
|
static void |
error(String message,
Object... args)
Sikuli error messages
switch on/off: always on |
static void |
exit(String message,
Object... args)
profile convenience: exiting a method
|
static int |
getDebugLevel() |
static void |
highlightOff() |
static void |
highlightOn() |
static void |
history(String message,
Object... args)
Deprecated.
|
static void |
info(String message,
Object... args)
informative Sikuli messages
switch on/off: Settings.InfoLogs |
static void |
init() |
static int |
is() |
static boolean |
is(int level) |
static boolean |
isLogToFile()
does Sikuli log go to a file?
|
static boolean |
isUserLogToFile()
does user log go to a file?
|
long |
lap(String message)
lap timer and print message with timer message
log output depends on Settings.ProfileLogs |
static void |
log(int level,
String message,
Object... args)
Sikuli debug messages with level
switch on/off: Settings.DebugLogs (off) and/or -Dsikuli.Debug |
static void |
log(String message,
Object... args)
Sikuli debug messages with default level
switch on/off: Settings.DebugLogs (off) and/or -Dsikuli.Debug |
static String |
logp(String msg,
Object... args) |
static String |
logx(int level,
String message,
Object... args)
INTERNAL USE: special debug messages
|
static void |
off() |
static void |
on(int level) |
static void |
on(String level) |
static void |
out(String msg) |
static void |
profile(String message,
Object... args)
Sikuli profiling messages
switch on/off: Settings.ProfileLogs, default off |
static void |
saveRedirected(PrintStream rdo,
PrintStream rde) |
static int |
setDebugLevel()
set debug level to default level
|
static void |
setDebugLevel(int level)
set debug level to given value
|
static void |
setDebugLevel(String level)
set debug level to given number value as string (ignored if invalid)
|
static boolean |
setLogFile(String fileName)
specify, where the logs should be written:
null - use from property sikuli.Logfile empty - use SikuliLog.txt in working folder not empty - use given filename |
static void |
setLogger(Object logger)
A logger object that is intended, to get Sikuli's log messages per redirection
|
static boolean |
setLoggerAction(String mAction)
specify the target method for redirection of Sikuli's action messages [log]
must be the name of an instance method of the previously defined logger and must accept exactly one string parameter, that contains the info message |
static boolean |
setLoggerAll(String mAll)
sets the redirection for all message types user, info, action, error and debug
must be the name of an instance method of the previously defined logger and
must accept exactly one string parameter, that contains the message text |
static boolean |
setLoggerDebug(String mDebug)
specify the target method for redirection of Sikuli's debug messages [debug]
must be the name of an instance method of the previously defined logger and must accept exactly one string parameter, that contains the info message |
static boolean |
setLoggerError(String mError)
specify the target method for redirection of Sikuli's error messages [error]
must be the name of an instance method of the previously defined logger and must accept exactly one string parameter, that contains the info message |
static boolean |
setLoggerInfo(String mInfo)
specify the target method for redirection of Sikuli's info messages [info]
must be the name of an instance method of the previously defined logger and must accept exactly one string parameter, that contains the info message |
static void |
setLoggerNoPrefix(Object logger)
same as setLogger(), but the Sikuli prefixes are omitted in all redirected messages
|
static boolean |
setLoggerUser(String mUser)
specify the target method for redirection of Sikuli's user log messages [user]
must be the name of an instance method of the previously defined logger and must accept exactly one string parameter, that contains the info message |
static boolean |
setUserLogFile(String fileName)
specify, where the user logs (Debug.user) should be written:
null - use from property sikuli.LogfileUser empty - use UserLog.txt in working folder not empty - use given filename |
static boolean |
shouldHighlight() |
static Debug |
startTimer()
start timer
log output depends on Settings.ProfileLogs |
static Debug |
startTimer(String message,
Object... args)
start timer with a message
log output depends on Settings.ProfileLogs |
static void |
test(String message,
Object... args)
Sikuli messages to use in tests
switch on/off: always on |
static void |
user(String message,
Object... args)
messages given by the user
switch on/off: Settings.UserLogs depending on Settings.UserLogTime, the prefix contains a timestamp the user prefix (default "user") can be set: Settings,UserLogPrefix |
public static String logfile
public static void init()
public static void highlightOn()
public static void highlightOff()
public static boolean shouldHighlight()
public static void setLogger(Object logger)
logger
- the logger objectpublic static void setLoggerNoPrefix(Object logger)
logger
- the logger objectpublic static boolean setLoggerAll(String mAll)
mAll
- name of the method where the message should be sentpublic static boolean setLoggerUser(String mUser)
mUser
- name of the method where the message should be sent
public static boolean setLoggerInfo(String mInfo)
mInfo
- name of the method where the message should be sent
public static boolean setLoggerAction(String mAction)
mAction
- name of the method where the message should be sent
public static boolean setLoggerError(String mError)
mError
- name of the method where the message should be sent
public static boolean setLoggerDebug(String mDebug)
mDebug
- name of the method where the message should be sent
public static void saveRedirected(PrintStream rdo, PrintStream rde)
public static void out(String msg)
public static boolean setLogFile(String fileName)
fileName
- null, empty or absolute filenamepublic static boolean isLogToFile()
public static boolean setUserLogFile(String fileName)
fileName
- null, empty or absolute filenamepublic static boolean isUserLogToFile()
public static int getDebugLevel()
public static int setDebugLevel()
public static void setDebugLevel(int level)
level
- valuepublic static void on(int level)
public static void on(String level)
public static boolean is(int level)
public static int is()
public static void off()
public static void setDebugLevel(String level)
level
- valid number stringpublic static void action(String message, Object... args)
message
- String or format string (String.format)args
- to use with format string@Deprecated public static void history(String message, Object... args)
message
- String or format string (String.format)args
- to use with format stringpublic static void info(String message, Object... args)
message
- String or format string (String.format)args
- to use with format stringpublic static void error(String message, Object... args)
message
- String or format string (String.format)args
- to use with format stringpublic static void test(String message, Object... args)
message
- String or format string (String.format)args
- to use with format stringpublic static void log(String message, Object... args)
message
- String or format string (String.format)args
- to use with format stringpublic static void user(String message, Object... args)
message
- String or format string (String.format)args
- to use with format stringpublic static void log(int level, String message, Object... args)
level
- valuemessage
- String or format string (String.format)args
- to use with format stringpublic static String logx(int level, String message, Object... args)
level
- valuemessage
- text or format stringargs
- for use with format stringpublic static void profile(String message, Object... args)
message
- String or format stringargs
- to use with format stringpublic static void enter(String message, Object... args)
message
- String or format stringargs
- to use with format stringpublic static void exit(String message, Object... args)
message
- String or format stringargs
- to use with format stringpublic static Debug startTimer()
public static Debug startTimer(String message, Object... args)
message
- String or format stringargs
- to use with format stringpublic long end()
public long lap(String message)
message
- String or format string