Forum How do I...?

Help parsing output of --server

morgul
I'm writing a service that responds to requests for reports, and spins up prince instances to generate those reports. Some of these reports are large (300+ pages), so it takes little while for prince to generate them. (Actually, about 3x faster than the software we're replacing with prince.) I'd like to report progress, and found a forum post mentioning the '--server' option. Running with this looks like exactly what I want to be doing.

My question is, though, is there any documentation on this? Output seem to be in for form of:

TYPE|MESSAGE\n


Where `TYPE` is a 3 character type identifier, and `MESSAGE` has a format dependent on the type. What I'm unsure of, however, is the newline termination; since some of this output seems to be log messages, what happens if the message has a newline in it? Does it get escaped, or do I have to handle that?

Any help with this would be greatly appreciated. Thanks!
mikeday
Easy, log messages never contain newlines! :D
morgul
That does make it easy!

Also, I noticed log messages look like:

msg|inf||Some message here...


This seems to be: "TYPE | LEVEL | ??? | Message", but I'm not sure what parameter "???" should be. Is it ever populated?
mikeday
The source of the error, eg. file / line number where appropriate. Not all error messages will have it; try parsing an invalid XML document for examples.
morgul
Thanks again; that got me exactly what I needed. This forum's such a great resource.