[Devel] Feature request: error/debug message extension.

David Robillard d at drobilla.net
Thu Jan 12 13:55:13 PST 2012


On Thu, 2012-01-12 at 16:53 +0100, Bent Bisballe Nyeng wrote:
> Hi
> 
> I have a suggestion for a new LV2 extension.
> 
> Many DAWs have some sort of terminal, showing status of session load as
> weel as errors.
> I suggest a LV2 extension giveing acces to this terminal (if present) in
> order to show error or debug messages to the user.
> The extension could be a simple function pointer to a function of the
> type 'void print_message(const char* message)'.

I don't think that would really do (for one it would be impossible to
actually do GUI logging in many cases without using static data, which
is pretty nasty and would mean everything in the process must log to the
same place).

This has been needed for ages, I was thinking something that matches
fprintf, except the first argument would be an arbitrary handle passed
by the host, e.g.

typedef void* LV2_Log_Handle;

typedef struct _LV2_Log {
	LV2_Log_Handle handle;
	int (*printf)(LV2_Log_Handle handle, const char* fmt, ...);
	int (*vprintf)(LV2_Log_Handle handle, va_list ap); 
}

This would let the host do pretty much anything (by putting whatever in
the handle), but also make a trivial implementation extremely simple
(you could literally use pointers to printf and vprintf with a FILE*
handle if you just want to print to stdout anyway).

One thing this does not address, though, is multiple streams e.g. for
errors, warnings, and info messages.

-dr




More information about the Devel mailing list