Please post in plain text or "internet style" as some email clients like to call it ...
On Wed, Mar 25, 2009 at 9:39 AM, Anna Södling <anna.sodl...@passagen.se> wrote: >> Hi, >> >> >> I want to use some logging in my scxml-file, for example upon entering >> and exiting a state. Unfortunately, I can't seem to get the hang of > how >> it works. I've got this line in my scxml-file: >> >> >> And the log output I get (in a console window in Eclipse) looks like >> this: >> 2009-mar-24 11:39:08 org.apache.comm >> ons.scxml.model.Log execute >> INFO: 'Renegade': Entering state: A >> 2009-mar-24 11:39:08 org.apache.commons.scxml.model.Log execute >> INFO: 'Renegade': Entering state: A >> > > > That seems OK to me (other than the fact it appeared twice, probably a > cut-n-paste error?). > <snip/> > No, it was supposed to enter state A twice during the running of the > state machine...though I guess I didn't really have to paste both > outputs :) > However, I'm wondering if there is some way to "clean up" the output? If > possible, I would like to remove the "org.apache.commons.scxml.model.Log > execute" and put the date and info on the same row. > <snap/> You'll have to look into a formatter / layout for the logging library you are using (or introduce one so you can do more than the commons-logging SimpleLog). >> Also, I'm doing some ordinary printed outputs (in Java) while I'm >> running my state machine, and the log info is not placed on the right >> place among these outputs either, but before all of them (so it > doesn't >> show up when I'm actually entering the state). >> And that's not really what I wanted. I would simply like to have an >> output that says "'Renegade': Entering state: A" (or something > similar) >> when I'm actually entering state A. Is this possible? Or have I >> missunderstood how the -tag works? >> > > > Please say more about the Java code which contains these print > statements. Are you using an AbstractStateMachine subclass, an > SCXMLListener or something else? ( content in the SCXML > document executes before code in both those specific cases). > <snip/> > We're using an AbstractStateMachine...we haven't extended it (since this > didn't work for some reason), but rather copied it and added some parts. > But it's a kind of ASM very similar to the original. > We have a little problem with this line of code in the onentry-listener > though: > invoke(entered.getId()); > Without it, we only get the original output, but when we add it, we get > a whole lot of error messages. We're not sure what it is doing, or > invoking? > <snap/> As the class Javadoc says, it calls the namesake method in the class for each state that has been entered. > > If you want more fine-grained control about the timing of your > procedural code within state changes (or sequencing even within a > particular or ), that kind of thing can be achieved > by using custom actions [1] to call your code from the appropriate > place(s) in SCXML executable content. > <snip/> > > > We've tried with several log expressions, some in onentry-tags, and some > not. Even though they're not shown exactly where we want to, they seem > to be shown in the right order. But, is this maybe a coincidence? > <snap/> I don't think so, but its hard to say anything without knowing the code. -Rahul > /Anna > > > > . > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org