correct patch in attachment without the mainconfig.c changes that are
part of another posted patch.

Fabio

On Wed, 2009-04-01 at 08:33 +0200, Fabio M. Di Nitto wrote:
> doesn't matter to me.. new patch in attachment.
> 
> I kept the argument documentation there so it's easier to read.
> 
> Fabio
> 
> On Tue, 2009-03-31 at 22:59 -0700, Steven Dake wrote:
> > can't we make log_printf_to_logs take arguments in the order they are
> > stored in the buffer instead of changing the passed argument order?
> > 
> > Regards
> > -steve
> > 
> > On Wed, 2009-04-01 at 07:54 +0200, Fabio M. Di Nitto wrote:
> > > 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
> > > _______________________________________________
> > > Openais mailing list
> > > [email protected]
> > > https://lists.linux-foundation.org/mailman/listinfo/openais
> > 
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais
Index: exec/logsys.c
===================================================================
--- exec/logsys.c	(revision 1975)
+++ exec/logsys.c	(working copy)
@@ -308,8 +308,8 @@
 */
 static void log_printf_to_logs (
 	const char *subsys,
+	const char *file_name,
 	const char *function_name,
-	const char *file_name,
 	int file_line,
 	unsigned int level,
 	char *buffer)
@@ -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,6 +434,14 @@
 		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[1],
@@ -839,7 +851,7 @@
 		 * expect the worker thread to output the log data once signaled
 		 */
 		log_printf_to_logs (logsys_loggers[subsys].subsys,
-			function_name, file_name, file_line, level,
+			file_name, function_name, file_line, level,
 			logsys_print_buffer);
 	} else {
 		/*
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to