Can custom code in a module change what is saved in a log file?

Is it possible to alter what information gets saved in a log file by adding custom code to a module?

If so what VASSAL interfaces/classes would need to be used/extended in the custom code?

Can you give an example of what you mean?

Thanks for the reply.

In VASL668, I added line numbers that appear in the chat window for certain actions. I don’t believe they are being saved to the log with the rest of the line. In this particular case, I suspect that this is due to the way that I implemented them and it should be fairly easy to fix by better constructing the strings that get passed to Chatter.show(). However, it got me thinking that there might be other, more substantive, information that we would want to save in the log. I don’t have anything specific in my head. Before thinking through what we might want to do, I thought I would ask if we could actually do anything?

By

However, it got me thinking that there might be other, more substantive, information that we would want to save in the log.

Do you just mean as text that appears in the Chat Window when you replay the log?

The following codes create a Command to display text in the chat window, executes the command on the local client, then sends the command to any open log file or connected multi-player clients.

final Command c = new Chatter.DisplayText(GameModule.getGameModule().getChatter(), "Hello World");
c.execute();
GameModule.getGameModule().sendAndLog(c);

Changing the Chatter itself using custom code to show line numbers won’t save anything to the log, the text has to be encoded in a DisplayText() command and passed to sendAndLog().

Duh!

Brain fart. My bad.

Thanks.

Doug