Skip to content

Commit

Permalink
added express boolean in logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mahajanankur committed Sep 9, 2020
1 parent a734ae1 commit 8e8dfdf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ exports.ExpressLoggerFactory = function (service, level, express = null, path) {
return {
getLogger: (filename) => {
filename = filename.replace(/^.*[\\\/]/, '');
return new LoggerBuilder(filename);
return new LoggerBuilder(filename, true);
}
}
// return new LoggerBuilder();
Expand All @@ -133,10 +133,11 @@ exports.ExpressLoggerFactory = function (service, level, express = null, path) {
* @class Logger
* @summary This is a actual logger object that prints the logs in the console and file appenders.
* @param {string} filename Filename of the javascript file.
* @param {boolean} isExpress Boolean if using this with express js, default is true.
* @returns {LoggerBuilder} LoggerBuilder.
*/
exports.Logger = function (filename) {
exports.Logger = function (filename, isExpress) {
filename = filename.replace(/^.*[\\\/]/, '');
return new LoggerBuilder(filename, expressApp ? true : false);
return new LoggerBuilder(filename, !isExpress ? true : false);
}

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "motifer",
"version": "1.1.1",
"version": "1.1.2",
"description": "Generic logs pattern manager for express, build on top of winston.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8e8dfdf

Please sign in to comment.