Page 1 of 1

Event logging

Posted: 2006-11-07T10:11:09-07:00
by el_supremo
I'm using Windows XP and IM 6.3.0.
I want MagickWand to create an event log to a file. At the beginning of my code I have:

Code: Select all

MagickWandGenesis();
(void) SetLogEventMask("all");
if(IsEventLogging())
	MessageBox(NULL,"LOG ON", "Note", MB_OK);
else
	MessageBox(NULL,"LOG OFF", "Note", MB_OK);
which indicates that logging is on. At the end I have:

Code: Select all

GetExceptionInfo(&exception);
logf = fopen("log.txt","wt");
if(ListLogInfo(logf,&exception))
	MessageBox(NULL,"LOGGED", "Note", MB_OK);
else
	MessageBox(NULL,"LOGGING FAILED", "Note", MB_OK);
fclose(logf);
MagickWandTerminus();
which crashes in ListLogInfo.
How do I set up a C MagickWand program so that it logs all events to a file?

Thanks
Pete

Posted: 2006-11-07T11:24:06-07:00
by magick
To send logging to a file, edit log.xml and change the output tag from console to file.

Posted: 2006-11-07T13:01:27-07:00
by el_supremo
Thanks for the speedy response.
For the info of anyone else, editing the output tag in coders/log.xml and including the statement "SetLogEventMask("all");" in the program is all that's required.

Once I'm done debugging I'll have to remember to go back to the log.xml file and put it back the way it was. It would be nice if a debugging program could override the output tag without actually changing the log.xml file - a SetLogOutputFile function perhaps.

Pete