MEDIUM: sink: build header in sink_write for log formats

This patch extends the sink_write prototype and code to
handle the rfc5424 and rfc3164 header.

It uses header building tools from log.c. Doing this some
functions/vars have been externalized.

facility and minlevel have been removed from the struct sink
and passed to args at sink_write because they depends of the log
and not of the sink (they remained unused by rest of the code
until now).
diff --git a/src/log.c b/src/log.c
index 622f7f9..482ce4d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -86,6 +86,18 @@
 	},
 };
 
+char *get_format_pid_sep1(int format, size_t *len)
+{
+	*len = log_formats[format].pid.sep1.data;
+	return log_formats[format].pid.sep1.area;
+}
+
+char *get_format_pid_sep2(int format, size_t *len)
+{
+	*len = log_formats[format].pid.sep2.data;
+	return log_formats[format].pid.sep2.area;
+}
+
 /*
  * This map is used with all the FD_* macros to check whether a particular bit
  * is set or not. Each bit represents an ACSII code. ha_bit_set() sets those
@@ -1429,7 +1441,7 @@
  * the beginning of logheader once a second and return the pointer to the
  * first character after it.
  */
-static char *update_log_hdr(const time_t time)
+char *update_log_hdr(const time_t time)
 {
 	static THREAD_LOCAL long tvsec;
 	static THREAD_LOCAL struct buffer host = { };
@@ -1473,7 +1485,7 @@
  * the beginning of logheader_rfc5424 once a second and return the pointer
  * to the first character after it.
  */
-static char *update_log_hdr_rfc5424(const time_t time)
+char *update_log_hdr_rfc5424(const time_t time)
 {
 	static THREAD_LOCAL long tvsec;
 	const char *gmt_offset;