java - 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"
鼠标悬停在相应的行上时收到消息)。
这个问题的原因可能是什么?
解决方案
推荐阅读
- algorithm - 部分洪水填充
- r - 在 data.table 中按行获取总和
- node.js - Socket.io 命名空间和房间:无法在带有令牌的特定 url 上接收事件
- javascript - React-native:如何根据在前一个屏幕上选择的数字呈现输入并能够存储输入
- mongoose - 猫鼬中的自定义距离功能
- xamarin - 基于xamarin android中另一个下拉列表的动态下拉列表
- microsoft-translator - 您能解释一下如何计算基线和自定义 BLEU 分数吗?
- python - AttributeError:'list' 对象没有属性'channel' discord.py
- angular - 从服务调用组件函数
- java - 与 mongo 驱动程序连接时 Spring Boot mongo 超时