intfiction.org

The Interactive Fiction Community Forum
It is currently Tue Apr 24, 2018 6:10 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Jan 12, 2018 11:09 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2485
Have you ever wished you could send logging messages before the Glk window system is initialised? Or that it was easier and more reliable to display error messages in your Glk-using VM?

I've had questions like this when working on my Emglken project. Git by default uses printf to display errors, which adds a huge amount of code to the Emscripten compiled Javascript. Glulxe on the other hand creates a new window for error messages, and in the Glk library I'm developing opening new windows is an asynchronous action, meaning almost the entire Glulxe codebase would have severe performance issues.

So I had the idea of defining a few additional functions for sending logging and error messages out-of-band, ie, outside the Glk window system. These functions would be fast and safe to call at all times.

Read the draft specification here.

As it is modelled on GlkOte, there are three severity levels, and I added a function for cancelling warnings because GlkOte does, even though I'm not too sure when that would be useful.

Thoughts and question?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jan 13, 2018 11:58 am 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2604
Location: The Midwest
I like the idea! I'm remembering the headache of debugging problems that occurred before the main window opened; functions like this would make it so much easier.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jan 13, 2018 11:49 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2485
For Inform 7 texts with substitutions, what is the most natural type of Glk API? Should I add buffer (ie, pointer + length) functions for that?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jan 13, 2018 11:58 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2604
Location: The Midwest
It seems like using the stream should be sufficient for that? Just switch on the message stream and use the usual printing functions.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Jan 14, 2018 12:11 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2485
Maybe. I couldn't remember if Inform 7 normally buffers it first or not.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group