似乎找不到包com.google.gwt.logging.Logging

时间:2018-05-15 14:50:42

标签: java logging gwt

我正在尝试在GWT项目中添加日志记录。我正在关注此文档:http://www.gwtproject.org/doc/latest/DevGuideLogging.html#Super_Simple_Recipe_for_Adding_Logging

目录树如下:

my-project
|-src
  |-main
    |-java
      |-portal
        |-Portal.gwt.xml
        |-client
          |-...
            |-MyClass.java

Portal.gwt.xml中,我添加了以下内容:

<inherits name="com.google.gwt.logging.Logging"/>

MyClass构造函数中,我添加了以下行:

Logger logger = Logger.getLogger("NameOfYourLogger");
logger.log(Level.SEVERE, "this message should get logged");

我还在顶部添加了这一行:

import com.google.gwt.logging.Logging;

但是,当我尝试编译项目时,出现以下错误:

  [ERROR] Line 64: Logger cannot be resolved to a type
  [ERROR] Line 64: Logger cannot be resolved
  [ERROR] Line 65: Level cannot be resolved to a variable

我也在我的IDE(IntelliJ IDEA)中打开了项目,似乎找不到新包(当我将鼠标悬停在相应的行上时,我收到了消息Cannot resolve symbol "Logging"。)

这个问题可能是什么原因?

0 个答案:

没有答案