Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move test files

  • Loading branch information...
commit 6b2f9c074828b1bbba2be8b55d0e7df85fa9c626 1 parent 89b6f82
@pquerna authored
Showing with 29 additions and 9 deletions.
  1. +0 −9 t.js
  2. +13 −0 tests/bench.js
  3. +16 −0 tests/t.js
View
9 t.js
@@ -1,9 +0,0 @@
-var logmagic = require('logmagic');
-var log = logmagic.local('mylib.foo.bar');
-console.log(log);
-log.info("Hello!");
-log.error("Accepts format strings too ${SOME_VAR}", {SOME_VAR: "myvalue"});
-log.trace("testing trace v0");
-logmagic.route("__root__", logmagic.TRACE1, "console");
-log.trace("testing trace v1", {slug: 1});
-console.log(log);
View
13 tests/bench.js
@@ -0,0 +1,13 @@
+var graylog = require('../lib/graylog');
+var ops = 100000;
+
+var start = (new Date().getTime());
+for (var i = 0; i < ops; i++) {
+ var str = graylog.logstr("testing.example.foo", 3, "hello world", {counter: i, account_id: 42, txnid: "fxxxxx"});
+ var str = graylog.logstr("testing.example.bar", 9, "hello baksdfnsdf", {special: 'aaa', account_id: 42, txnid: "fxxxxx"});
+}
+var end = (new Date().getTime());
+
+var ms = (end - start);
+
+console.log(ops + " logstr operations in " + ms + "ms, " + (ops/ms) * 1000 + " (logstr/second)");
View
16 tests/t.js
@@ -0,0 +1,16 @@
+var logmagic = require('../lib/logmagic');
+var log = logmagic.local('mylib.foo.bar');
+//console.log(log);
+log.info("Hello!");
+log.error("more stuff", {SOME_VAR: "myvalue"});
+log.trace("testing trace v0");
+
+logmagic.route("__root__", logmagic.TRACE1, "console");
+//logmagic.route("__root__", logmagic.TRACE1, "graylog2-stderr");
+log.trace("testing trace v1", {slug: 1});
+
+log = logmagic.local('mylib.foo.cars');
+log.trace("hello world", {counter: 33, account_id: 42, txnid: "fxxxxx"});
+log.trace("hello baksdfnsdf", {special: 'aaa', account_id: 42, txnid: "fxxxxx", full_message: "loooong message"});
+
+//console.log(log);
Please sign in to comment.
Something went wrong with that request. Please try again.