[Yanel-dev] Debug instead of Warning

Michael Wechner michael.wechner at wyona.com
Sun Feb 6 00:16:07 CET 2011


Hi Cedric

I have applied your patch locally:

patch -p0 < log-warn-to-debug.patch
patching file 
src/build/java/org/wyona/yanel/ant/MergeResourceTypesConfigsTask.java
patching file src/impl/java/org/wyona/yanel/impl/navigation/NodeRTIImpl.java
patching file 
src/impl/java/org/wyona/yanel/impl/resources/usecase/thread/UsecaseThread.java
patching file 
src/contributions/resources/nutch/src/java/org/wyona/yanel/impl/resources/NutchResource.java
patching file 
src/contributions/resources/policymanager/src/java/org/wyona/yanel/impl/resources/policymanager/PolicyManagerResource.java
patching file 
src/contributions/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResource.java
patching file 
src/contributions/resources/data-repo-sitetree/src/java/org/wyona/yanel/impl/resources/navigation/DataRepoSitetreeResource.java
patching file 
src/contributions/resources/atom-entry/src/java/org/wyona/yanel/impl/resources/AtomEntryResource.java
patching file 
src/contributions/resources/morelikethis/src/java/org/wyona/yanel/impl/resources/morelikethis/MoreLikeThisResource.java
patching file 
src/contributions/resources/redirect/src/java/org/wyona/yanel/impl/resources/redirect/RedirectResource.java
patching file 
src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/WikiResource.java
patching file 
src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/XHTMLBeanContentHandler.java
patching file 
src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/search/SearchResource.java
patching file 
src/contributions/resources/timeline/src/java/edu/mit/simile/yanel/impl/resources/timeline/TimelineResource.java
patching file 
src/contributions/resources/forgotpw/src/java/org/wyona/yanel/impl/resources/forgotpw/ForgotPassword.java
patching file 
src/contributions/resources/calendar/src/java/org/wyona/yanel/impl/resources/calendar/CalendarResource.java
patching file 
src/contributions/resources/security-api/src/java/org/wyona/yanel/impl/resources/securityapi/UserManagerResource.java
patching file 
src/realms/welcome-admin/yanel/resources/show-realms/src/java/org/wyona/yanel/impl/resources/showrealms/ShowRealms.java
patching file 
src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/UpdateInfo.java
patching file 
src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/UpdateFinder.java
patching file 
src/core/java/org/wyona/yanel/cmdl/communication/CommandLineRequest.java
patching file src/core/java/org/wyona/yanel/core/ResourceTypeRegistry.java
patching file 
src/core/java/org/wyona/yanel/core/transformation/AccessControlTransformer.java
patching file src/core/java/org/wyona/yanel/core/util/ConfigurationUtil.java
Hunk #1 FAILED at 87.
1 out of 1 hunk FAILED -- saving rejects to file 
src/core/java/org/wyona/yanel/core/util/ConfigurationUtil.java.rej
patching file src/core/java/org/wyona/yanel/core/map/RealmManager.java
patching file 
src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java
patching file 
src/resources/tinymce/src/java/org/wyona/yanel/impl/resources/tinymce/TinyMCEResource.java
patching file 
src/resources/testing-control/src/java/org/wyona/yanel/impl/resources/TestingControlResource.java
patching file 
src/webapp/src/java/org/wyona/yanel/servlet/security/impl/DefaultWebAuthenticatorImpl.java
patching file src/webapp/src/java/org/wyona/yanel/servlet/HeartbeatJob.java
patching file src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java
Hunk #1 succeeded at 1420 (offset -2 lines).
Hunk #2 succeeded at 2478 (offset 29 lines).


but with the recent changes got some failures.

Do you mind to run your script again and send an upated patch?

Thanks

Michael

On 1/31/11 3:09 PM, Cedric Staub wrote:
> On Fri, Jan 28, 2011 at 05:11:02PM +0000, Rob Adamson wrote:
>> On 28 January 2011 07:09, basZero<baszero at gmail.com>  wrote:
>>> Hi,
>>> another super simple patch.
>>> I would actually wish that you would go through all yanel classes and check
>>> all lines with log.warn and check whether these are really warnings for the
>>> operators running a system in production.
>> I second this :)
> Ok guys, I wrote a shell script that goes through all Java source files
> and replaces every occurence of lines like:
>
> log.warn("DEBUG: ...");
> log.error("DEBUG: ...");
>
> With the more appropriate:
>
> log.debug("...");
>
> I ran the script on the latest revision of Yanel and the result is a
> patch that you can find as an attachment to this email.
>
> For reference, here's the script (but you need zsh to run it):
> ----------
> for f in $(grep -l "log.error(\"DEBUG: " **/*.java); do
>      sed 's/log.error("DEBUG: /log.debug("/g' -i $f;
> done
> for f in $(grep -l "log.warn(\"DEBUG: " **/*.java); do
>      sed 's/log.warn("DEBUG: /log.debug("/g' -i $f;
> done
> ----------
>
> @Michael: Can we get this commited quickly? It makes the log files much
> cleaner and therefore more useful.
>
> Cheers,
> Cedric



More information about the Yanel-development mailing list