final class DebugFilter extends Object
GraalDebugConfig.Dump
,
GraalDebugConfig.Log
, GraalDebugConfig.Meter
and GraalDebugConfig.Time
options.
These options enable the associated debug facility if their filter matches the
name of the current
scope. For the GraalDebugConfig.Dump
and GraalDebugConfig.Log
options, the log
or dump level is set. The GraalDebugConfig.Meter
and GraalDebugConfig.Time
options don't have a level, for them level = 0
means disabled and a level > 0
means enabled.
A filter is a list of comma-separated terms of the form <pattern>[:<level>]
.
<pattern>
is interpreted as a glob pattern if it contains a "*" or "?" character.
Otherwise, it is interpreted as a substring. If <pattern>
is empty, it matches every
scope. If :<level>
is omitted, it defaults to Debug.DEFAULT_LOG_LEVEL
. The term
~<pattern>
is a shorthand for <pattern>:0
to disable a debug facility for a
pattern.
The resulting log level of a scope is determined by the last matching term. If no term
matches, the log level is 0 (disabled). A filter with no terms matches every scope with a log
level of Debug.DEFAULT_LOG_LEVEL
.
Debug.DEFAULT_LOG_LEVEL
.
:1
*
Debug.DEFAULT_LOG_LEVEL
.
CodeGen,CodeInstall
Debug.DEFAULT_LOG_LEVEL
.
CodeGen:2,CodeInstall:1
:1,Dead:2
:1,Dead:0
Code*
Debug.DEFAULT_LOG_LEVEL
.
Code,~Dead
Debug.DEFAULT_LOG_LEVEL
.
Modifier and Type | Class and Description |
---|---|
private static class |
DebugFilter.Term |
Modifier and Type | Field and Description |
---|---|
private DebugFilter.Term[] |
terms |
Modifier | Constructor and Description |
---|---|
private |
DebugFilter(String[] terms) |
Modifier and Type | Method and Description |
---|---|
int |
matchLevel(String input)
Check whether a given input is matched by this filter, and determine the log level.
|
static DebugFilter |
parse(String spec) |
String |
toString() |
private final DebugFilter.Term[] terms
private DebugFilter(String[] terms)
public static DebugFilter parse(String spec)
public int matchLevel(String input)