-
Notifications
You must be signed in to change notification settings - Fork 1
/
util.js
41 lines (34 loc) · 924 Bytes
/
util.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
const logSuccess = (message) => {
message = `AgilityCMS => ${message} `;
console.log('\x1b[32m%s\x1b[0m', message);
}
const logWarning = (message) => {
message = `AgilityCMS => ${message} `;
console.log('\x1b[33m%s\x1b[0m', message);
}
const logError = (message) => {
message = `AgilityCMS => ${message} `;
console.log('\x1b[31m%s\x1b[0m', message);
}
const logInfo = (message) => {
message = `AgilityCMS => ${message} `;
console.log(message);
}
const logDebug = (message) => {
console.log('#######################################################################');
message = `AgilityCMS(debug) => ${message} `;
console.log('"\x1b[35m%s\x1b[0m', message);
};
module.exports = {
logDebug,
logInfo,
logError,
logWarning,
logSuccess,
asyncForEach
}