Edenhill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/79747


Change subject: Added 'output = null' for testing purposes.
......................................................................

Added 'output = null' for testing purposes.

Change-Id: If5f1e2fe89acf5caa60c21a3c4b1b88723097fa6
---
M config.c
M varnishkafka.c
M varnishkafka.conf.example
M varnishkafka.h
4 files changed, 10 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/software/varnish/varnishkafka 
refs/changes/47/79747/1

diff --git a/config.c b/config.c
index 1d11f4c..feb5479 100644
--- a/config.c
+++ b/config.c
@@ -161,6 +161,8 @@
                        outfunc = out_kafka;
                else if (!strcmp(val, "-") || !strcmp(val, "stdout"))
                        outfunc = out_stdout;
+               else if (!strcmp(val, "null"))
+                       outfunc = out_null;
                else {
                        snprintf(errstr, errstr_size,
                                 "Unknown outputter \"%s\": " 
diff --git a/varnishkafka.c b/varnishkafka.c
index 142c59c..368a361 100644
--- a/varnishkafka.c
+++ b/varnishkafka.c
@@ -1112,6 +1112,12 @@
        printf("%.*s\n", (int)len, buf);
 }
 
+/**
+ * Null outputter
+ */
+void out_null (const char *buf, size_t len) {
+}
+
 
 /**
  * Currently selected outputter.
diff --git a/varnishkafka.conf.example b/varnishkafka.conf.example
index f63fc15..a28bdd0 100644
--- a/varnishkafka.conf.example
+++ b/varnishkafka.conf.example
@@ -82,6 +82,7 @@
 # Where to output varnish log lines:
 #  kafka  - (default) send to kafka broker
 #  stdout - just print to stdout (behave like varnishncsa)
+#  null   - (test) collect all tags specified by format but dont output 
anything
 output = kafka
 
 
diff --git a/varnishkafka.h b/varnishkafka.h
index 0434920..f118b84 100644
--- a/varnishkafka.h
+++ b/varnishkafka.h
@@ -173,4 +173,5 @@
 
 void out_kafka (const char *buf, size_t len);
 void out_stdout (const char *buf, size_t len);
+void out_null (const char *buf, size_t len);
 extern void (*outfunc) (const char *buf, size_t len);

-- 
To view, visit https://gerrit.wikimedia.org/r/79747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5f1e2fe89acf5caa60c21a3c4b1b88723097fa6
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/varnish/varnishkafka
Gerrit-Branch: master
Gerrit-Owner: Edenhill <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to