@@ -112,6 +112,8 @@ Trace events should use types as follows:
Format strings should reflect the types defined in the trace event. Take
special care to use PRId64 and PRIu64 for int64_t and uint64_t types,
respectively. This ensures portability between 32- and 64-bit platforms.
+Format strings must not end with a newline character. It is the responsibility
+of backends to adapt line ending for proper logging.
Each event declaration will start with the event name, then its arguments,
finally a format string for pretty-printing. For example:
@@ -277,6 +277,9 @@ class Event(object):
if fmt.find("%m") != -1 or fmt_trans.find("%m") != -1:
raise ValueError("Event format '%m' is forbidden, pass the error "
"as an explicit trace argument")
+ if fmt.endswith(r'\n"'):
+ raise ValueError("Event format must not end with a newline "
+ "character")
if len(fmt_trans) > 0:
fmt = [fmt_trans, fmt]