DOpus.Output() from button editor

Hello! o)

When using DOpus.Output("some text") from the button editor (directly running the button with F5), the console window of the lister (utility pane) will not print the date stamp in front of the text. If I use DOpus.Output("some text", true) to raise the error message, it will print the date stamp before the text.

It's a bit weird in general in the console for all the script buttons it seems, if they output to the console, the datestamp seems to missing all the time, but if a script addin is using DO.Output() there will be timestamps, and for errors from script buttons as well as mentioned. Is there a chance to unify this? It's kinda hard to format any output if datestamp presence is toggling like this. o)

Thanks! o)

You can use the third argument to add a timestamp without turning the message into an error:

function OnClick(clickData)

You're right that buttons vs script add-ins are different here, and that third argument doesn't do anything when it's called from an add-in. I think the logic is that you know when you push a button, so the place the messages come from is usually obvious, but script add-ins can be triggered passively, so it's important to know which script the output comes from (and if we display the script name, we also display the timestamp).

Maybe doing the same for buttons makes sense, adding the button name into the log and forcing timestamps on for everything, although I'd have to look in more detail to see how feasible that is. I'm not sure if the button name is available to the script framework currently.

That sounds reasonable. The simplest way to make it uniform, would be to suppress the timestamps for errors printed by script buttons I think. But that would be uniform only in a sense, that buttons never print the datestamp while script addins always would (by default). I think I like your idea or way of solving this better, having the button name in the log by default would be helpful I think and unify output as well.

The third parameter on DO.Output(), is surely helpful (did not know about it). It's unfortunate though, that DO.Output("", true, false) still prints the timestamp for errors, so you can only unify into the "with datestamp" direction. If errors could be printed without datestamp as well, it would allow full control over how it's supposed to look. The datestamps can be cumbersome as well at times, but using "true" by default for all the other outputs already makes this much better since text will start at a specific column, much easier to trim the datestamps if they get in the way.

With missing third param or = false

05 - No Excess - The Vibe.flac
26.01.2021 11:46  E   Tracknumber [5] is higher than total number of tracks/files.
06 - Spellbound - Heaven On Earth.flac
26.01.2021 11:46  E   Tracknumber [6] is higher than total number of tracks/files.

With third param = true

26.01.2021 11:47  05 - No Excess - The Vibe.flac
26.01.2021 11:47  E   Tracknumber [5] is higher than total number of tracks/files.
26.01.2021 11:47  06 - Spellbound - Heaven On Earth.flac
26.01.2021 11:47  E   Tracknumber [6] is higher than total number of tracks/files.

I learned and got helped!
Thank you! o)