~ubuntu-branches/ubuntu/vivid/node-log4js/vivid

« back to all changes in this revision

Viewing changes to test/gelfAppender-test.js

  • Committer: Package Import Robot
  • Author(s): Mike Gabriel
  • Date: 2014-08-20 14:19:20 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140820141920-8cl8s6ak7uzl8jfe
Tags: 0.6.18-1
* New upstream release.
* debian/rules:
  + Add get-orig-source rule.
* debian/control:
  + Bump Standards: to 3.9.5. No changes needed.
  + Move packaging Git to pkg-javascript namespace on Alioth.
* debian/patches:
  + Refresh and update 001_debian-log4js-examples.patch. Make sure
    upstream's new example files find the log4js module when installed
    on Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
      console: fakeConsole
74
74
    }
75
75
  });
76
 
  
 
76
 
77
77
  log4js.clearAppenders();
78
78
  log4js.addAppender(appender.configure(options || {}), category || "gelf-test");
79
79
  return {
87
87
};
88
88
 
89
89
vows.describe('log4js gelfAppender').addBatch({
90
 
  
 
90
 
91
91
  'with default gelfAppender settings': {
92
92
    topic: function() {
93
93
      var setup = setupLogging();
115
115
        return message;
116
116
      },
117
117
      'should be in the gelf format': function(message) {
118
 
        assert.equal(message.version, '1.0');
 
118
        assert.equal(message.version, '1.1');
119
119
        assert.equal(message.host, require('os').hostname());
120
120
        assert.equal(message.level, 6); //INFO
121
 
        assert.equal(message.facility, 'nodejs-server');
122
 
        assert.equal(message.full_message, message.short_message);
123
 
        assert.equal(message.full_message, 'This is a test');
 
121
        assert.equal(message.short_message, 'This is a test');
124
122
      }
125
123
    }
126
124
  },
166
164
      },
167
165
      'should pick up the options': function(message) {
168
166
        assert.equal(message.host, 'cheese');
169
 
        assert.equal(message.facility, 'nonsense');
 
167
        assert.equal(message._facility, 'nonsense');
170
168
      }
171
169
    }
172
170
  },
246
244
      },
247
245
      'should pick up the options': function(message) {
248
246
        assert.equal(message.host, 'cheese');
249
 
        assert.equal(message.facility, 'nonsense');
 
247
        assert.equal(message._facility, 'nonsense');
250
248
        assert.equal(message._every1, 'Hello every one'); // the default value
251
249
        assert.equal(message._every2, 'Overwritten!'); // the overwritten value
252
250
        assert.equal(message._myField, 'This is my field!'); // the value for this message only
253
 
        assert.equal(message.short_message, 'Just testing.'); // skip the field object 
254
 
        assert.equal(message.full_message, 'Just testing.'); // should be as same as short_message 
 
251
        assert.equal(message.short_message, 'Just testing.'); // skip the field object
255
252
      }
256
253
    }
257
254
  }