java - 如何在cleartool中获取XML文件中的日志。我想要 XML 文件中的命令cleartool lshistory 的输出

标签 java logging clearcase cleartool

我正在尝试命令 cleartool lshistory > file.txt 通过此我得到文本格式的文件,类似地我想要 XML 格式的日志文件。

最佳答案

cleartool lshistory不提供 xml 输出。

您需要解析其输出,并自己生成预期的 xml。

akshay jain询问in the comments :

how we can get the logs in well formatted way so I can parse it easily and store the values in db?

Using fmt_ccase ,您可以精确控制所需的输出,以便更好地解析(如 in this example ):

cleartool lshistory -fmt "Element: %n| Date: %d| User:%u| Operation: %e| Object:%[type]p| SimpleType: %m| OperationKind: %o\n" -all /vobs/vob_name

OP 补充道:

I want the version changes logs only not other logs, is there any way?

我提到了 %c(评论消息),但是:

Is there a way to handle the %c output, because it is disturbing the format of log file?

然后我提到 %Nc,它可以避免在评论消息末尾附加换行符。

OP confirms in the chat :

%Nc works thanks

关于java - 如何在cleartool中获取XML文件中的日志。我想要 XML 文件中的命令cleartool lshistory 的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30913554/

相关文章:

java - 任何增加 Rational Clearcase 远程客户端内存设置的方法

java - 这个HashMap使用线程安全吗?

java - 重新设定一组基线

clearcase - 在 ClearCase 中撤消删除文件

java - 是否有适用于所有类(而非接口(interface))的 AspectJ TypePattern?

java - Junit 测试方法的日志输出是否正确?

在 Wicket 中记录用户操作

java - 使用 Hibernate 查询语言时如何从列表 <Objects> 进行转换?

java - java计算数组中的重复次数

java - 在测试和 Controller 中标记为事务的方法的不同行为