import xmltree, chronicles type XmlRecord[Output] = object output*: Output template initLogRecord*(r: var XmlRecord, lvl: LogLevel, topics: string, name: string) = r.output.append "\n" template setProperty*(r: var XmlRecord, key: string, val: auto) = r.output.append textBlockIndent, "<", key, ">", escape($val), "\n" template setFirstProperty*(r: var XmlRecord, key: string, val: auto) = r.setProperty key, val template flushRecord*(r: var XmlRecord) = r.output.append "\n" r.output.flushOutput customLogStream xmlStream[XmlRecord[StdOutOutput]] publicLogScope: stream = xmlStream