
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A simple, beautiful, and easy-to-use logger!
It's pretty straightforward:
const { MooLogger } = require("moologger")
const logger = new MooLogger()
logger.info("Hello world!")
Configuration can be done in the constructor:
new MooLogger({
logLevel: 4,
/*
0: disabled,
1: fatal,
2: error,
3: warn,
4: info,
5: debug,
default: 4
*/
logFolder: "path/to/folder", // The directory where the logger stores logs
timestamp: true, // Display timestamp? (true by default)
lang: {
debug: "DEBUG",
info: "INFO",
warn: "WARN",
error: "ERROR",
fatal: "FATAL",
}, // You can customize badge strings like this
})
logger.debug(...data)
logger.info(...data)
logger.warn(...data)
logger.error(...data)
logger.fatal(...data)
It just works:tm:, like the built-in console.
The most simple usage you can possibly think of:
const logger = new MooLogger()
// info & debug
logger.info("Important", "data")
logger.debug("$ Pay Taxes $")
// warn
logger.warn(
"`--global`, `--local` are deprecated.",
{
reason: "I'm telling you anyway."
}
)
// error & fatal
const error = new Error("I don't know what happened")
logger.error(error, "This error was not my fault!")
try {
(function shake() {shake()})()
} catch (earthquakeError) {
logger.fatal(earthquakeError, "EARTHQUAKE DETECTED! STOPPING PROGRAM...")
}
Setting the log level — you can think of it as "filtering" levels.
const { LogLevel } = require("moologger")
const logger = new MooLogger({
/*
{
DISABLED: 0,
FATAL: 1,
ERROR: 2,
WARN: 3,
INFO: 4,
DEBUG: 5
}
*/
logLevel: LogLevel.WARN
// levels below WARN (INFO, DEBUG) won't be logged
})
logger.warn("Hello!") // logged
logger.fatal("ANOTHER EARTHQUAKE!") // logged
logger.info("Paid taxes") // not logged
You can set the badge text that corresponds to the log level.
If a field is not set, it'll be replaced with the default one.
const lang = {
/* It's just like i18n */
debug: "Bug Killer",
info: "πληροφορίες",
warn: "uyarı",
error: "ข้อผิดพลาด",
fatal: "致命的な誤り"
}
new MooLogger({ lang }) // register it
As the name implies, a log folder (directory) stores logs from MooLogger. Log files are named as the current timestamp.
If not set, MooLogger will disable this feature.
new MooLogger({
logFolder: "path/to/dir"
})
If you prefer logging into one fixed (singular) file, use logFile instead.
Same as logFolder, MooLogger will disable this feature if not set.
new MooLogger({
logFile: "my.log"
})
Note that DO NOT set logFolder and logFile at the same time, you have to choose between them. Life is so cruel!
FAQs
A simple, beautiful and easy to use logger!
We found that moologger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.