
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 lightweight vanilla JavaScript logger with colors, timestamps, grouping, and pretty printing.
☕ Logging in JavaScript is easy but with
logger, it's like logging with espresso shots.
No moreconsole.log()spam. Justslog.log(),slog.error(), and chill.
logger is a lightweight, vanilla JavaScript logging plugin that makes console logging cleaner and easier. It provides short method names (slog.log, slog.error, slog.info), automatic message truncation, log level control, pretty printing for objects/arrays, custom tags, grouping support, and color-coded output all optimized for dark mode themes.
log, error, infonone, error, info, log, all[LOG] [DB] message)[TYPE] labelgroup, groupEnd)logger.js to your projectDownload or copy the logger.js file into your project folder.
| Method | Description |
|---|---|
slog.log(...args) | Logs a general message |
slog.error(...args) | Logs an error message |
slog.info(...args) | Logs an informational message |
slog.setLevel(level) | Sets log level (none, error, info, log, all) |
slog.setDefaultLevel() | Resets log level to show all |
slog.enable() | Enables logging |
slog.disable() | Disables logging |
slog.setTimestamps(bool) | Enables/disables timestamps in logs |
slog.setAutoTruncingOn() | Enables auto truncation of long messages |
slog.setAutoTruncingOff() | Disables auto truncation |
slog.group(label) | Starts a console group with the given label |
slog.groupEnd() | Ends the current console group |
<script src="logger.js"></script>
<script>
slog.log('This is a regular log message.'); // [LOG] [STRING] This is a regular log message.
slog.error('Oops! Something went wrong.'); // [ERROR] [STRING] Oops! Something went wrong.
slog.info('FYI: Everything is working fine.'); // [INFO] [STRING] FYI: Everything is working fine.
// Long message truncated (default 100 chars)
slog.log('LONG', 'This is a really long message that should be truncated after 100 characters to keep things neat in the console...');
// Disable auto truncation
slog.setAutoTruncingOff();
slog.log('LONG', 'This long message will NOT be truncated even if it is very long and verbose...');
// Pretty print object with custom tag
slog.info('USER', { id: 123, name: 'Alice', roles: ['admin', 'editor'] });
// Pretty print array
slog.log('DATA', [1, 2, 3, 4, 5]);
// Enable timestamps
slog.setTimestamps(true);
slog.log('Now with a timestamp!');
// Log level control
slog.setLevel('error'); // Only errors will show
slog.log('This log will NOT show');
slog.error('This error will show');
slog.setDefaultLevel(); // Reset to show all logs
// Enable/disable logging
slog.disable();
slog.log('This will NOT show');
slog.enable();
slog.log('Logging enabled again');
// Grouping logs
slog.group('User Actions');
slog.log('Clicked button');
slog.error('Button action failed');
slog.groupEnd();
</script>
FAQs
A lightweight vanilla JavaScript logger with colors, timestamps, grouping, and pretty printing.
We found that slogger-js demonstrated a healthy version release cadence and project activity because the last version was released less than 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.