
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Welcome to LemonLog! The zesty, easy-to-use logging solution for your Node.js applications. Whether you're debugging your latest feature or keeping an eye on production issues, LemonLog is here to brighten your day (and your console) with colorful, structured logs. π
Install LemonLog
npm install lemonlog
Usage
First, require and create a new instance of LemonLog in your project:
const log = require('lemonlog')('MyApp');
or
import LemonLog from 'lemonlog';
const log = new LemonLog('MyApp');
Then, log away:
log.info('This is an info message!');
log.debug('Hereβs something you might find interesting...', { emoji: "π" });
log.inspect('Inspecting a deeply nested object', { a: { b: { c: { d: 1 } } } });
log.warn('Warning! Warning! π¨');
log.error('Oops! Something went wrong. π₯');
Use DEBUG to filter logs:
$ DEBUG=* node demo/demo.js
myApp:info ------ This is an info message { a: 1 } +0ms
myApp:debug ----- This is a debug message +0ms
myApp:inspect --- [
myApp:inspect --- 'This is a full json depth inspect message',
myApp:inspect --- {
myApp:inspect --- a: { b: { c: { d: 1 } } }
myApp:inspect --- }
myApp:inspect --- ] +0ms
myApp:warn ------ This is a warning +0ms
myApp:error ----- This is an error +0ms
myApp:debug ----- [ 'Custom success message' ]
myApp:debug ----- { return: 'ok' } +0ms
myApp:error ----- { return: 'error' }
myApp:error ----- [ 'Custom error message' ]
myApp:error ----- null +0ms
myApp:debug ----- Success: { return: 'ok' } +1ms
myApp:error ----- { return: 'error' }
myApp:error ----- null +1ms
$ DEBUG=myApp:error* node demo/demo.js
myApp:error ----- This is an error +0ms
myApp:error ----- { return: 'error' }
myApp:error ----- [ 'Custom error message' ]
myApp:error ----- null +0ms
myApp:error ----- { return: 'error' }
myApp:error ----- null +1ms
Customize Your Callbacks
Handle logs with your own custom logic:
async function someAsyncFunction(fail, cbk) {
if (fail) {
cbk({ return: "error" }, null);
} else {
cbk(null, { return: "ok" });
}
}
// Custom callback example
someAsyncFunction(false, log.callback("Custom success message"));
someAsyncFunction(true, log.callback("Custom error message"));
// Exec example
someAsyncFunction(false, log.exec(result => {
log.debug('Success:', result);
}));
someAsyncFunction(true, log.exec(result => {
log.debug('Error:', result);
}));
We believe that logging shouldn't just be about capturing information. It should be a delightful part of your development process. With LemonLog, we aim to bring a little joy and color to your console, making it easier and more fun to sift through your logs.
Got ideas on how to make LemonLog even better? We'd love to hear from you! Check out our contribution guidelines to get started.
Thank you for choosing LemonLog for your logging needs. We hope it adds a splash of color to your projects and makes logging something to look forward to.
Happy coding!
The MIT License (MIT)
Copyright (c) Martin Clasen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
π LemonLog - Simplify Your Node.js Logging
The npm package lemonlog receives a total of 30 weekly downloads. As such, lemonlog popularity was classified as not popular.
We found that lemonlog 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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.