olofson / eel

The Extensible Embeddable Language for scripting in realtime applications
http://eelang.org/
zlib License
46 stars 4 forks source link

Create an abstraction layer for text printing #123

Open chille opened 5 years ago

chille commented 5 years ago

When using EEL as a scripting langugare in an application, or running on an embedded system, it would be really useful to have better control of where and how text is printed.

It should be possible to print debug messages both from EEL and from C. These messages should have a "verbosity" settings with an integer value, maybe 1-5. It should be possible to distinguish messages that are sent from EEL and C. I guess most things printed from C would be considered a debug message.

Normal text messages should be catched separate from the debug messages. It should be possible to distinguish messages from EEL and C.

Maybe we need more information like what module/class/whatever sent the message. It might also be useful to create some kind of "scope". An example; the compiler is used to compile an EEL script loaded by the user. Something goes wrong when compiling. This message needs to be shown as a separate popup window.

When wrinting this we also need to keep in mind that it should be easy to add support for log files.

Either all message printing needs to be realtime safe, or two different sets of printing function will be needed.

(This is related to #122)