Skip to content

Package io.github.qishr.cascara.common.util

Class Tracer

java.lang.Object
        io.github.qishr.cascara.common.util.CommandLine.Tracer

Enclosing Class:
    io.github.qishr.cascara.common.util.CommandLine


public static final class Tracer

Utility class for printing internal debug statements.

Method Summary

Modifier and Type Method Description
public TraceLevel getLevel() Returns the trace level that needs to be matched or exceeded for internal tracing statements to be printed.
public void setLevel(TraceLevel level) Sets the trace level that needs to be matched or exceeded for internal tracing statements to be printed.
public boolean isDebug() Returns whether the current trace level is DEBUG (the highest).
public boolean isInfo() Returns whether the current trace level is INFO or higher.
public boolean isWarn() Returns whether the current trace level is WARN or higher.
public boolean isOff() Returns whether the current trace level is OFF (the lowest).
public void warn(String msg, Object[] params) Prints the specified message if the current trace level is WARN or higher.
public void info(String msg, Object[] params) Prints the specified message if the current trace level is INFO or higher.
public void debug(String msg, Object[] params) Prints the specified message if the current trace level is DEBUG or higher.
public String toString()

Method Details

getLevel

public TraceLevel getLevel()

Returns the trace level that needs to be matched or exceeded for internal tracing statements to be printed.The initial trace level is WARN, unless system property "picocli.trace" is set to another valid TraceLevel value.

Returns:

the trace level that needs to be matched or exceeded for tracing statements to be printed


setLevel

public void setLevel(TraceLevel level)

Sets the trace level that needs to be matched or exceeded for internal tracing statements to be printed.The initial trace level is WARN, unless system property "picocli.trace" is set to another valid TraceLevel value.

Parameters:

level - the trace level that needs to be matched or exceeded for tracing statements to be printed


isDebug

public boolean isDebug()

Returns whether the current trace level is DEBUG (the highest).


isInfo

public boolean isInfo()

Returns whether the current trace level is INFO or higher.


isWarn

public boolean isWarn()

Returns whether the current trace level is WARN or higher.


isOff

public boolean isOff()

Returns whether the current trace level is OFF (the lowest).


warn

public void warn(String msg, Object[] params)

Prints the specified message if the current trace level is WARN or higher.

Parameters:

msg - the message to print; may use String#format(String, Object...) syntax

params - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.

See Also:

Formatter


info

public void info(String msg, Object[] params)

Prints the specified message if the current trace level is INFO or higher.

Parameters:

msg - the message to print; may use String#format(String, Object...) syntax

params - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.

See Also:

Formatter


debug

public void debug(String msg, Object[] params)

Prints the specified message if the current trace level is DEBUG or higher.

Parameters:

msg - the message to print; may use String#format(String, Object...) syntax

params - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.

See Also:

Formatter


toString

public String toString()