Hi Steven,
the patch adds filename support to logsys_format_set.
While testing, I noticed that filename and function name were swapped in
the output (basically %n was behaving as %f and viceversa).
Tracked down to that invalid usage of the API at the bottom of the
patch.
Fabio
Index: exec/logsys.c
===================================================================
--- exec/logsys.c (revision 1975)
+++ exec/logsys.c (working copy)
@@ -365,6 +365,10 @@
len = strcpy_cutoff (&output_buffer[output_buffer_idx], buffer, cutoff);
output_buffer_idx += len;
break;
+ case 'f':
+ len = strcpy_cutoff (&output_buffer[output_buffer_idx], file_name, cutoff);
+ output_buffer_idx += len;
+ break;
}
format_buffer_idx += 1;
} else {
@@ -430,10 +434,18 @@
arg_size_idx += buf_uint32t[arg_size_idx] + 1;
words_processed += buf_uint32t[arg_size_idx] + 1;
}
+
+ /*
+ * (char *)arguments[0] -> subsystem
+ * (char *)arguments[1] -> file_name
+ * (char *)arguments[2] -> function_name
+ * (char *)arguments[3] -> message
+ */
+
log_printf_to_logs (
(char *)arguments[0],
+ (char *)arguments[2],
(char *)arguments[1],
- (char *)arguments[2],
file_line,
level,
(char *)arguments[3]);
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais