fixed all lint errors except ones which require refactoring of code

This commit is contained in:
Gareth Jones
2013-06-04 08:17:36 +10:00
parent f998d7e81a
commit 5d6f00eda4
12 changed files with 792 additions and 698 deletions
+14 -11
View File
@@ -1,14 +1,17 @@
var layouts = require("../layouts"),
mailer = require("nodemailer"),
os = require('os');
"use strict";
var layouts = require("../layouts")
, mailer = require("nodemailer")
, os = require('os');
/**
* SMTP Appender. Sends logging events using SMTP protocol.
* It can either send an email on each event or group several logging events gathered during specified interval.
* It can either send an email on each event or group several
* logging events gathered during specified interval.
*
* @param config appender configuration data
* config.sendInterval time between log emails (in seconds), if 0
* then every event sends an email
* @param layout a function that takes a logevent and returns a string (defaults to basicLayout).
* all events are buffered and sent in one email during this time; if 0 than every event sends an email
*/
function smtpAppender(config, layout) {
layout = layout || layouts.basicLayout;
@@ -19,7 +22,7 @@ function smtpAppender(config, layout) {
var sendTimer;
function sendBuffer() {
if (logEventBuffer.length == 0) {
if (logEventBuffer.length === 0) {
return;
}
@@ -31,11 +34,11 @@ function smtpAppender(config, layout) {
}
var msg = {
to: config.recipients,
subject: config.subject || subjectLayout(firstEvent),
text: body,
headers: {"Hostname": os.hostname()}
};
to: config.recipients,
subject: config.subject || subjectLayout(firstEvent),
text: body,
headers: {"Hostname": os.hostname()}
};
if (config.sender) {
msg.from = config.sender;
}