3 ms·
It's complicated. Basically, every time I build a new product of any complexity, I end up spending the first week or so cobbling together some sort of logging/d
by blister 11y ago
It's complicated. Basically, every time I build a new product of any complexity, I end up spending the first week or so cobbling together some sort of logging/debugging framework that I'll use for the entire lifecycle of the project. It ends up being different for each project (I'm a govt contractor, so each of our contracts usually has a completely different tech stack), but the core usually revolves around allowing me to quickly and easily send specific variables and values to some place where I can view them all at the same time.
In a nodejs project, think of it like having a bunch of calls to console.log() littered all over the place. Then when it's time to go live, I usually run around ripping all those calls out, or your code ends up with a bunch of calls to the logger commented out.
What this system does, and what I've been using it for, is flexibly let you put in calls using a really simple API to the logger and pass whatever kind of data you want. Then, since all the logging is occurring through the API to my service, you can leave all of those calls in your code when you launch or go to production.
The part (to me) that is really sweet is that you can have your app deployed to production and have logging basically turned off. Then, from our web console, select a specific session that you're trying to debug and flip a toggle that turns on more granular logging.
We also have customizable alerts, like I mentioned, so that if you have a critical error, you can have our system send you a text message. This could be super critical for a small business or startup, I think. It's easy to add Twilio and toss that sort of stuff into a new project if you so desire, but honestly I've gotten kind of tired of writing the same thing over and over again. What I'm trying to do is build a system that is flexible enough for power users, but simple enough to quickly drop it into a new project and be up and running.
Then our design allows for multiple projects within an organization, so you can have logging on your website track people through a conversion funnel or something and then have a separate app that tracks usage on your mobile iOS app.
To me, the best part is the simple libraries I've built for a bunch of different languages.
Javascript would be as simple as:
var LogDebug = require('logdebug');
var ld = new LogDebug('API_KEY');
ld.log('Simple log message');
ld.critical('Super important alert!');
ld.log('Simple message with complex data', { something: true });
Then if your next project is C#, you can use the same framework in C#:
using LogDebug;
LogDebug ld = new LogDebug('API_KEY');
ld.log('Simple log message');
ld.critical('Super important alert!');
ld.log('Simple message with complex data', SomeDictionary_or_List);
It seems really useful to me, so I convinced one of my engineering friends to join me as my CTO and let me try and learn about marketing and sales.
We have a lot of ideas for where we want to go in the future, but for now we're racing to get our MVP out the door with the useful stuff we already have working. Thanks for asking. :)