首页 > 解决方案 > com.google.gwt.logging.Logging 包似乎没有找到

问题描述

我正在尝试在 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"鼠标悬停在相应的行上时收到消息)。

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

标签: javalogginggwt

解决方案


推荐阅读