[stringtemplate-interest] Logging framework?

Barrie Treloar baerrach at gmail.com
Thu Apr 14 17:49:27 PDT 2011


On Thu, Apr 14, 2011 at 10:08 PM, Sam Harwell
<sharwell at pixelminegames.com> wrote:
> Ter is going to have to answer this fully, but from what I've seen these
> messages are generally in place for the development of ST itself. Currently
> you can provide a custom implementation of STErrorListener or ErrorManager
> to handle compilation and runtime messages for ST users.

Got one of those :)

My main problem was that moving from ST 3 to ST 4 wasn't a simple
"flick the switch" and I ran into problems that were not easily
diagnosable without access to the code.

Perhaps its the idiotic way I'm invoking ST, ala Maven -> Ant ->
Javascript and where input attributes are in a single JSON file and
templates are located on the classpath and which template to invoke is
passed to Javascript via Ant parameters.
I'll swear, with hand on heart, that what I am doing is sane.

But because of this, I found that templates weren't being located.
Even with STGroup.verbose = true I didn't get enough information to
find the answer.

In the end I think it was a simple problem, something like I was
asking it to load the template "MyTemplate.st" when I shouldn't have
been including the .st suffix.

If I can contribute to the code so that this sort of problem is better
diagnosed and this save someone else (or even me when I come back to
this project six months from now) I will be a happy man.

I have a personal aversion to things like STGroup.verbose for
debugging, but I'll swallow that if that's what Ter wants.
If I can get some guidance on how these extra debug/info statements
can be incorporated then I can do it in the "blessed way"

Cheers.


More information about the stringtemplate-interest mailing list