Added the basic files for Loggly appender

appender, example, test
not tested yet!
This commit is contained in:
Christiaan Westerbeek
2014-01-10 21:18:16 +01:00
parent bb644a1632
commit 5286c50375
3 changed files with 99 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
"use strict";
var assert = require('assert')
, vows = require('vows')
, layouts = require('../lib/layouts')
, sandbox = require('sandboxed-module');
vows.describe('../lib/appenders/loggly').addBatch({
'appender': {
topic: function() {
var messages = []
, fakeLoggly = {
log: function(msg) { messages.push(msg); }
}
, appenderModule = sandbox.require(
'../lib/appenders/loggly',
{
globals: {
'loggly': fakeLoggly
}
}
)
, appender = appenderModule.appender(layouts.messagePassThroughLayout);
appender({ data: ["blah"] });
return messages;
},
'should output to loggly': function(messages) {
assert.equal(messages[0], 'blah');
}
}
}).exportTo(module);