Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "logmoji", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "đĒĩ Very small logging package with emojis for node.js", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "jest" | ||
"test": "jest", | ||
"docs:dev": "vitepress dev docs", | ||
"docs:build": "vitepress build docs", | ||
"docs:preview": "vitepress preview docs" | ||
}, | ||
@@ -9,0 +12,0 @@ "keywords": [], |
<p align="center" class="logo-section"> | ||
<img src="https://i.ibb.co/gvD8wP1/Vulcan-Salute-Medium-Skin-Tone.png" height="80" width="80"/> | ||
</br> | ||
<img src="https://halitsever-api.vercel.app/api/repo-title?title=LogMoji"> | ||
<img src="https://halitsever-api.vercel.app/api/repo-title?title=Logmoji"> | ||
@@ -6,0 +6,0 @@ <p align="center"> |
@@ -1,41 +0,41 @@ | ||
const main = (params) => { | ||
const ConfigClass = require("./config.class"); | ||
const getDateLog = require("./utils/get-date-log"); | ||
const ConfigClass = require("./config.class"); | ||
const getDateLog = require("./utils/get-date-log"); | ||
const createLogger = (params) => { | ||
const configInstance = new ConfigClass({ ...(params || {}) }); | ||
const config = configInstance.getConfig(); | ||
const success = (...args) => { | ||
console.info(`${config?.timestamp ? getDateLog() : ""} â Success: `, ...args); | ||
}; | ||
const log = (level, ...args) => { | ||
const logSymbols = { | ||
success: "â ", | ||
fail: "đ", | ||
warn: "đ ", | ||
error: "đ¨", | ||
info: "âšī¸", | ||
log: "đ", | ||
}; | ||
const fail = (...args) => { | ||
console.warn(`${config?.timestamp ? getDateLog() : ""} đ Fail: `, ...args); | ||
}; | ||
const logFunction = { | ||
success: console.info, | ||
fail: console.warn, | ||
warn: console.warn, | ||
error: console.error, | ||
info: console.info, | ||
log: console.log, | ||
}; | ||
const warn = (...args) => { | ||
console.warn(`${config?.timestamp ? getDateLog() : ""} â ī¸ Warning: `, ...args); | ||
const timestamp = config?.timestamp ? getDateLog() : ""; | ||
logFunction[level](`${timestamp} ${logSymbols[level]} ${level.charAt(0).toUpperCase() + level.slice(1)}: `, ...args); | ||
}; | ||
const error = (...args) => { | ||
console.error(`${config?.timestamp ? getDateLog() : ""} đ¨ Error: `, ...args); | ||
}; | ||
const info = (...args) => { | ||
console.error(`${config?.timestamp ? getDateLog() : ""} âšī¸ Info: `, ...args); | ||
}; | ||
const log = (...args) => { | ||
info(...args); | ||
}; | ||
return { | ||
success, | ||
fail, | ||
error, | ||
info, | ||
warn, | ||
log, | ||
success: (...args) => log("success", ...args), | ||
fail: (...args) => log("fail", ...args), | ||
error: (...args) => log("error", ...args), | ||
info: (...args) => log("info", ...args), | ||
warn: (...args) => log("warn", ...args), | ||
log: (...args) => log("log", ...args), | ||
}; | ||
}; | ||
module.exports = main; | ||
module.exports = createLogger; |
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
9200
12
63