English 中文(简体)
如何查找并替换系统.out.println, 使用日食中的 Reg 表达式使用 log.info
原标题:How to find and replace System.out.println with log.info using reg expression in eclipse
  • 时间:2012-05-24 09:21:38
  •  标签:
  • java
  • eclipse

我有一个旧的 java 工程, 它包含超过 100 个源文件, 需要添加 log4j, 需要在系统内附加全部数据 。 输出. println 到 log.info 。 查找并替换为 Reg 表达式可能有助于我完成这个任务 。 我使用日蚀 6 。

问题回答

您可以使用日食功能 搜索功能 搜索功能 搜索功能 搜索功能也非常适合在文件内搜索 。 在日食工具栏Search & gt; Java Search

在方法名称中的搜索字符串类型中,然后选择“方法”无线电框。然后单击搜索。

这是自我解释 你可以搜索方法, 额外的建筑师

如果您也想搜索文件名中的字符串, 也非常好 。

在日食中, 我会使用 Ctrl+H 来提出搜索菜单。 穿过顶部的标签, 直到您在搜索字符串中找到“ 任务搜索” 类型, “ system. out. println () ”, 告诉它在您的工程中搜索 *. java 文件, 然后按替换按钮 。


-i “s/system.out.println/log.info/g” `grep system.out.println-rl/path'





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签