aboutsummaryrefslogtreecommitdiffstats
path: root/vespalog/src/test/simple/logtest.cpp
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /vespalog/src/test/simple/logtest.cpp
Publish
Diffstat (limited to 'vespalog/src/test/simple/logtest.cpp')
-rw-r--r--vespalog/src/test/simple/logtest.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/vespalog/src/test/simple/logtest.cpp b/vespalog/src/test/simple/logtest.cpp
new file mode 100644
index 00000000000..b532b2a4b8f
--- /dev/null
+++ b/vespalog/src/test/simple/logtest.cpp
@@ -0,0 +1,37 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <vespa/log/log.h>
+
+LOG_SETUP("logtest",
+ "$Id: logtest.cpp 119439 2011-04-19 09:32:27Z arnej $");
+
+int
+main(int, char **argv)
+{
+ EV_STARTING("logtest");
+ LOG(info, "Starting up, called as %s", argv[0]);
+ EV_STARTED("logtest");
+ EV_RELOADING("something");
+ EV_RELOADED("something");
+ EV_CRASH("something", getpid(), SIGTERM);
+ EV_PROGRESS("batch-index", 7, 100);
+ EV_PROGRESS("unbounded-batch-index", 9);
+ EV_COUNT("hits", 3);
+ EV_VALUE("some value", 1./3);
+
+ LOG(info, "backslash: \\");
+ int n;
+ LOG(info, "Will log 20 spam messages now every 50ms");
+ for (n = 1; n <= 5; n++) {
+ LOG(spam, "log message %d/%d", n, 100);
+ usleep(50000);
+ }
+ LOG(info, "Exiting.");
+ EV_STOPPING("logtest", "clean exit");
+ EV_STOPPED("logtest", getpid(), 0);
+ exit(EXIT_SUCCESS);
+}