branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Please can japid support a clean System.out #38

Closed efficacy closed 12 years ago

efficacy commented 12 years ago

Hi,

I'm trying to use Japid in a context where important data is written to System out. Unfortunately Japid also writes a bunch of internal diagnostics to System.out which get tangled with the real data.

Possibilities for addressing this include writing to System.err instead, using some sort of controllable logging, or (as in the example I am including here) simply making the output globally switchable.

Looking at the Japid codebase, I'm slightly worried that I might not have caught all writing to system out, particularly as the page class generation code seems to put System.out.println statements in the generated classes. I'd appreciate your take on whether this is something that Japid can do, or whether I would be better off with a different template system in this case.

Thanks, Frank..

branaway commented 12 years ago

Hi,

Thanks for the input. Let think it a bit.

Bing

2011/11/17 efficacy < reply@reply.github.com

Hi,

I'm trying to use Japid in a context where important data is written to System out. Unfortunately Japid also writes a bunch of internal diagnostics to System.out which get tangled with the real data.

Possibilities for addressing this include writing to System.err instead, using some sort of controllable logging, or (as in the example I am including here) simply making the output globally switchable.

Looking at the Japid codebase, I'm slightly worried that I might not have caught all writing to system out, particularly as the page class generation code seems to put System.out.println statements in the generated classes. I'd appreciate your take on whether this is something that Japid can do, or whether I would be better off with a different template system in this case.

Thanks, Frank..

You can merge this Pull Request by running:

git pull https://github.com/efficacy/Japid master

Or you can view, comment on it, or merge it online at:

https://github.com/branaway/Japid/pull/38

-- Commit Summary --

  • made system out diagnostics switchable

-- File Changes --

M src.japid/cn/bran/japid/compiler/TranslateTemplateTask.java (10) M src.japid/cn/bran/japid/rendererloader/RendererCompiler.java (4) M src.japid/cn/bran/japid/rendererloader/TemplateClassLoader.java (3) M src.japid/cn/bran/japid/template/JapidRenderer.java (5) A src.japid/cn/bran/japid/util/JapidFlags.java (7)

-- Patch Links --

https://github.com/branaway/Japid/pull/38.patch https://github.com/branaway/Japid/pull/38.diff


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/pull/38

branaway commented 12 years ago

May I ask what context you were using Japid in, with Play or standalone?

branaway commented 12 years ago

If I remember it correctly, there are only two cases in that Japid generates code to send messages to sysout: the log command and thestopWatch directive.

efficacy commented 12 years ago

On 17 November 2011 16:25, Bing Ran/冉兵 reply@reply.github.com wrote:

Thanks for the input. Let think it a bit.

Sure. Thanks for the prompt reply.

Frank.

efficacy commented 12 years ago

On 17 November 2011 16:59, Bing Ran/冉兵 reply@reply.github.com wrote:

May I ask what context you were using Japid in, with Play or standalone?

Standalone in this case.

Frank.

branaway commented 12 years ago

merged and changed the default value of verbose to true to keep the behavior consistant.

efficacy commented 12 years ago

Excellent! many thanks.

Frank.

On 17 November 2011 17:27, Bing Ran/冉兵 reply@reply.github.com wrote:

merged and changed the default value of verbose to true to keep the behavior consistant.


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/pull/38#issuecomment-2778946