winston-mail
Advanced tools
Comparing version 0.4.0 to 0.5.0
0.5.0 / 2015-09-16 | ||
================== | ||
* Handle Error meta [perrin4869] | ||
* Enable boolean to log only the selected level and none above [jamie-ez] | ||
* Docs for subject templating | ||
0.4.0 / 2015-04-13 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -38,2 +38,3 @@ /* | ||
this.level = options.level || 'info'; | ||
this.unique = options.unique || false; | ||
this.silent = options.silent || false; | ||
@@ -75,5 +76,15 @@ this.subject = options.subject ? template(options.subject) : template("winston: {{level}} {{msg}}"); | ||
if (this.silent) return callback(null, true); | ||
if (this.unique && this.level != level) return callback(null, true); | ||
var body = msg; | ||
// convert meta to string if it is an error | ||
if(meta instanceof Error) { | ||
meta = { | ||
message: meta.message, | ||
name: meta.name, | ||
stack: meta.stack | ||
}; | ||
} | ||
// add meta info into the body if not empty | ||
@@ -80,0 +91,0 @@ if (meta !== null && meta !== undefined && (typeof meta !== 'object' || Object.keys(meta).length > 0)) |
{ | ||
"name": "winston-mail", | ||
"description": "A mail transport for winston", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"author": "Marc Harter <wavded@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -45,5 +45,12 @@ # winston-mail [![Build Status](https://travis-ci.org/wavded/winston-mail.svg?branch=master)](https://travis-ci.org/wavded/winston-mail) | ||
* __level:__ Level of messages that this transport should log. | ||
* __unique:__ Boolean flag indicating whether to log only the declared level and none above. | ||
* __silent:__ Boolean flag indicating whether to suppress output. | ||
* __html:__ Boolean flag indicating whether to send mail body as html attach. | ||
## Subject templating | ||
The __subject__ option takes a mustache template string that exposes the following fields: | ||
- `{{level}}` - Log level | ||
- `{{msg}}` - First line of the error message | ||
## License | ||
@@ -50,0 +57,0 @@ The MIT License (MIT) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10194
122
67