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

How to get the logs in XML file in cleartool. I want the output of command cleartool lshistory in XML file

我正在尝试通过命令 cleartool lshistory > file.txt 我正在获取文本格式的文件 同样我想要 XML 格式的日志文件.

cleartool lshistory 不提供 xml 输出。

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

akshay jain asks :

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, you can control exactly the ouput you want, for better parsing (as 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