Skip to content

Commit 144567c

Browse files
feat: remove log enable variables
1 parent 072b2f1 commit 144567c

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ typings/
6060
# next.js build output
6161
.next
6262

63-
.serverless
63+
.serverless
64+
.idea/

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "common-lambda-tools",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Libs to support lambda development",
55
"main": "./src/index.js",
66
"repository": {

src/logger/index.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
const infoEnable = process.env.LOG_INFO_ENABLE;
2-
const errorEnable = process.env.LOG_ERROR_ENABLE;
3-
const warnEnable = process.env.LOG_WARN_ENABLE;
4-
51
const error = function (functionName, errorMessage, err) {
6-
if (errorEnable)
7-
console.error(`${functionName} - ${errorMessage}`, err);
2+
console.error(`${functionName} - ${errorMessage}`, err);
83
}
94

105
const info = function (functionName, message) {
11-
if (infoEnable)
12-
console.info(`${functionName} - ${message}`);
6+
console.info(`${functionName} - ${message}`);
137
}
148

159
const warn = function (functionName, message) {
16-
if (warnEnable)
17-
console.warn(`${functionName} - ${message}`);
10+
console.warn(`${functionName} - ${message}`);
1811
}
1912

2013
const audit = function (uuid, action, payload) {
21-
console.info('AUDIT', {'timestamp': Date.now(), 'uuid': uuid, 'action': action, 'payload': payload});
14+
console.info('AUDIT', {'timestamp': Date.now(), 'uuid': uuid, 'action': action, 'payload': payload});
2215
}
2316

2417
module.exports = {
2518
error,
2619
info,
2720
warn,
2821
audit
29-
};
22+
};

0 commit comments

Comments
 (0)