32
32
import com .jetbrains .lang .dart .util .DartResolveUtil ;
33
33
import io .flutter .FlutterBundle ;
34
34
import io .flutter .editor .FlutterIconLineMarkerProvider ;
35
+ import io .flutter .logging .PluginLogger ;
35
36
import io .flutter .settings .FlutterSettings ;
36
37
import io .flutter .utils .OpenApiUtils ;
37
38
import org .jetbrains .annotations .NotNull ;
@@ -61,7 +62,7 @@ public class FontPreviewProcessor {
61
62
private static final Pattern IMPORT_STATEMENT_PATTERN = Pattern .compile ("^\\ s*import\\ s+[\" ']([-_. $A-Za-z0-9/]+\\ .dart)[\" '].*" );
62
63
private static final Map <String , Set <String >> ANALYZED_PROJECT_FILES = new HashMap <>();
63
64
private static final Map <String , WorkItem > WORK_ITEMS = new HashMap <>();
64
- private static Logger LOG = Logger . getInstance (FontPreviewProcessor .class );
65
+ private static final @ NotNull Logger LOG = PluginLogger . createLogger (FontPreviewProcessor .class );
65
66
66
67
static {
67
68
UNSUPPORTED_PACKAGES .put ("flutter_icons" , FlutterBundle .message ("icon.preview.disallow.flutter_icons" ));
@@ -83,7 +84,6 @@ public void generate(@NotNull Project project) {
83
84
if (ANALYZED_PROJECT_FILES .containsKey (project .getBasePath ())) {
84
85
return ;
85
86
}
86
- LOG = FlutterSettings .getInstance ().isVerboseLogging () ? Logger .getInstance (FontPreviewProcessor .class ) : null ;
87
87
log ("Analyzing project " , project .getName ());
88
88
ANALYZED_PROJECT_FILES .put (project .getBasePath (), new HashSet <>());
89
89
ProjectManager .getInstance ().addProjectManagerListener (project , new ProjectManagerListener () {
@@ -436,20 +436,16 @@ private static boolean isInSdk(String path) {
436
436
}
437
437
438
438
private static void log (String msg , String ... msgs ) {
439
- if (LOG != null ) {
440
- final StringBuilder b = new StringBuilder ("ICONS -- " );
441
- b .append (msg );
442
- for (String s : msgs ) {
443
- b .append (" " ).append (s );
444
- }
445
- LOG .info (b .toString ());
439
+ final StringBuilder b = new StringBuilder ("ICONS -- " );
440
+ b .append (msg );
441
+ for (String s : msgs ) {
442
+ b .append (" " ).append (s );
446
443
}
444
+ LOG .debug (b .toString ());
447
445
}
448
446
449
447
private static void log (String msg , Exception ex ) {
450
- if (LOG != null ) {
451
- LOG .info ("ICONS--" + msg , ex );
452
- }
448
+ LOG .debug ("ICONS--" + msg , ex );
453
449
}
454
450
455
451
static class WorkItem {
0 commit comments