我正在尝试命令 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/