我刚刚找到了Jenkins Log Parser插件:https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin并且想知道它是否可以帮助我解决我的问题,但是几乎没有关于你可以自己编写的解析文件的描述。
Down是我的控制台输出Build的一个例子,有许多行使用DEBUG - 我现在想要的是以某种方式将它们从控制台输出隐藏起来。这个插件可以实现吗?或者通过任何其他方式直接在詹金斯。
1455617636458 addons.manager DEBUG Application has been upgraded
1455617636466 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1455617636467 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1455617636468 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1455617636469 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1455617636469 addons.manager DEBUG Starting provider: XPIProvider
1455617636470 addons.xpi DEBUG startup
1455617636470 addons.xpi INFO Mapping fxdriver@googlecode.com to C:\WINDOWS\TEMP\anonymous.cc070da49079449ea1508d9addffb57a.webdriver-profile\extensions\fxdriver@googlecode.com
1455617636470 addons.xpi INFO SystemAddonInstallLocation directory is missing
1455617636471 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}
1455617636471 addons.xpi DEBUG Skipping unavailable install location app-system-share
1455617636471 addons.xpi DEBUG Skipping unavailable install location app-system-local
1455617636471 addons.xpi DEBUG checkForChanges
1455617636472 addons.xpi DEBUG Loaded add-on state from prefs: {}
1455617636472 addons.xpi DEBUG New add-on fxdriver@googlecode.com in app-profile
1455617636472 addons.xpi DEBUG getModTime: Recursive scan of fxdriver@googlecode.com
1455617636475 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1455617636475 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1455617636475 addons.xpi DEBUG getInstallState changed: true, state: {"app-profile":{"fxdriver@googlecode.com":{"d":"C:\\WINDOWS\\TEMP\\anonymous.cc070da49079449ea1508d9addffb57a.webdriver-profile\\extensions\\fxdriver@googlecode.com","st":1455617636309,"mt":1454669720000}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","st":1455030447240,"mt":1454721165000}}}
1455617636480 addons.xpi-utils DEBUG Opening XPI database C:\WINDOWS\TEMP\anonymous.cc070da49079449ea1508d9addffb57a.webdriver-profile\extensions.json
1455617636480 addons.xpi-utils DEBUG New add-on fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1455617636498 DeferredSave.extensions.json DEBUG Save changes
1455617636499 addons.xpi-utils DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1455617636501 DeferredSave.extensions.json DEBUG Starting timer
1455617636501 DeferredSave.extensions.json DEBUG Save changes
1455617636501 addons.xpi-utils INFO Hiding the updated system add-ons.
1455617636502 addons.manager DEBUG Registering startup change 'installed' for fxdriver@googlecode.com
1455617636502 addons.xpi-utils DEBUG Make addon app-profile:fxdriver@googlecode.com visible
1455617636502 DeferredSave.extensions.json DEBUG Save changes
1455617636502 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1455617636502 DeferredSave.extensions.json DEBUG Save changes
1455617636502 addons.xpi DEBUG Updating XPIState for {"id":"fxdriver@googlecode.com","syncGUID":"5eJxViaIyNe8","location":"app-profile","version":"2.51.0","type":"extension","internalName":null,"updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Firefox WebDriver","description":"WebDriver implementation for Firefox","creator":"Simon Stewart","homepageURL":null},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\WINDOWS\\TEMP\\anonymous.cc070da49079449ea1508d9addffb57a.webdriver-profile\\extensions\\fxdriver@googlecode.com","installDate":1455617636309,"updateDate":1455617636309,"applyBackgroundUpdates":1,"bootstrap":false,"size":3235385,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true,"hasBinaryComponents":true,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"3.0","maxVersion":"47.0"}],"targetPlatforms":[{"os":"Darwin","abi":null},{"os":"SunOS","abi":null},{"os":"FreeBSD","abi":null},{"os":"OpenBSD","abi":null},{"os":"WINNT","abi":"x86-msvc"},{"os":"Linux","abi":null}],"multiprocessCompatible":false,"signedState":0}
1455617636502 addons.xpi DEBUG getModTime: Recursive scan of fxdriver@googlecode.com
1455617636504 addons.xpi DEBUG Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"hPG5NuzgvTEp","location":"app-global","version":"44.0.1","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1455030447240,"updateDate":1455030447240,"applyBackgroundUpdates":1,"skinnable":true,"size":24172,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"44.0.1","maxVersion":"44.0.1"}],"targetPlatforms":[]}
1455617636504 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1455617636505 DeferredSave.extensions.json DEBUG Save changes
1455617636505 addons.xpi DEBUG Updating database with changes to installed add-ons
1455617636505 addons.xpi-utils DEBUG Updating add-on states
1455617636505 addons.xpi-utils DEBUG Writing add-ons list
1455617636515 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1455617636515 addons.manager DEBUG Provider finished startup: XPIProvider
1455617636515 addons.manager DEBUG Starting provider: LightweightThemeManager
1455617636515 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager
1455617636515 addons.manager DEBUG Provider finished startup: LightweightThemeManager
1455617636516 addons.manager DEBUG Starting provider: GMPProvider
1455617636519 addons.manager DEBUG Registering shutdown blocker for GMPProvider
1455617636519 addons.manager DEBUG Provider finished startup: GMPProvider
1455617636519 addons.manager DEBUG Starting provider: PluginProvider
1455617636519 addons.manager DEBUG Registering shutdown blocker for PluginProvider
1455617636519 addons.manager DEBUG Provider finished startup: PluginProvider
1455617636519 addons.manager DEBUG Completed startup sequence
1455617636717 addons.manager DEBUG Starting provider:
1455617636717 addons.manager DEBUG Registering shutdown blocker for
1455617636717 addons.manager DEBUG Provider finished startup:
1455617636777 DeferredSave.extensions.json DEBUG Starting write
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: [D3D11] create swap chain failed: 0x887a0022[GFX1-]: [D3D11] create swap chain failed: 0x887a0022
1455617636884 addons.repository DEBUG No addons.json found.
1455617636885 DeferredSave.addons.json DEBUG Save changes
1455617636886 DeferredSave.addons.json DEBUG Starting timer
1455617636893 addons.manager DEBUG Starting provider: PreviousExperimentProvider
1455617636894 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider
1455617636894 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider
1455617636899 DeferredSave.extensions.json DEBUG Write succeeded
1455617636899 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 17
1455617636941 DeferredSave.addons.json DEBUG Starting write
1455617636964 DeferredSave.addons.json DEBUG Write succeeded
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: [D3D11] create swap chain failed: 0x887a0022|[1][GFX1-]: [D3D11] create swap chain failed: 0x887a0022[GFX1-]: [D3D11] create swap chain failed: 0x887a0022
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: [D3D11] create swap chain failed: 0x887a0022|[1][GFX1-]: [D3D11] create swap chain failed: 0x887a0022|[2][GFX1-]: [D3D11] create swap chain failed: 0x887a0022[GFX1-]: [D3D11] create swap chain failed: 0x887a0022
Powerlimit: 817
1455617653872 addons.manager DEBUG shutdown
1455617653872 addons.manager DEBUG Calling shutdown blocker for XPIProvider
1455617653873 addons.xpi DEBUG shutdown
1455617653873 addons.xpi-utils DEBUG shutdown
1455617653873 addons.manager DEBUG Calling shutdown blocker for LightweightThemeManager
1455617653873 addons.manager DEBUG Calling shutdown blocker for GMPProvider
1455617653874 addons.manager DEBUG Calling shutdown blocker for PluginProvider
1455617653874 addons.manager DEBUG Calling shutdown blocker for
1455617653875 addons.manager DEBUG Calling shutdown blocker for PreviousExperimentProvider
1455617653877 addons.xpi DEBUG Notifying XPI shutdown observers
1455617653879 addons.manager DEBUG Async provider shutdown done
答案 0 :(得分:2)
老了,但如果有人还在寻找答案......
在测试执行命令中添加一个grep,用于过滤掉那些。例如。 调用runMyTests.cmd | grep -v -e'^ [0-9] {13,}。*'
这将排除输出中以13位或更多位数开头的所有行。你将摆脱那些垃圾的大部分。
另一个选择是将它传递到一个文件,输入和grep,然后仍然存档该文件以防万一你可能需要它以便以后进行一些调试: 调用runMyTests.cmd> runmytests.log 2>& 1 输入runmytests.log | grep -v -e'^ [0-9] {13,}。*'
grep(以及sed,awk,curl +其他超级有用的linux工具)来自于使用git扩展名,将\ bin文件夹添加到路径中。或者,单独安装这些工具,例如, http://gnuwin32.sourceforge.net/packages.html
答案 1 :(得分:0)
标记版本适用于Linux - 但是当我在Windows上工作时,我必须找到一个类似的版本而不安装任何东西。
我现在使用FINDSTR
函数 - 它有点复杂,因为它只支持regex的基本函数,并且不支持{13}计数乘数...
| findstr /v /r ^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
这是与上面相同的功能,只是在windows中...如果可能的话,你可以在windows上安装grep - 在我的情况下不是 - 这使得它更容易