MINOR: log: move the log code to sess_build_logline() to add extra arguments

The current build_logline() can only be used with valid streams, which
means it is not suitable for use from muxes. We start by moving it into
another more generic function which takes the session as an argument,
to avoid complexifying all the internal API for jsut a few use cases.
This new function is not supposed to be called directly from outside so
we'll be able to instrument it to support several calling conventions.

For now the behaviour and conditions remain unchanged.
diff --git a/include/proto/log.h b/include/proto/log.h
index 05a7acc..3e17733 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -34,6 +34,8 @@
 #include <types/proxy.h>
 #include <types/stream.h>
 
+#include <proto/stream.h>
+
 extern struct pool_head *pool_head_requri;
 extern struct pool_head *pool_head_uniqueid;
 
@@ -63,7 +65,13 @@
 /*
  * Builds a log line.
  */
-int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format);
+int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t maxsize, struct list *list_format);
+
+static inline int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format)
+{
+	return sess_build_logline(strm_sess(s), s, dst, maxsize, list_format);
+}
+
 
 /*
  * send a log for the stream when we have enough info about it.