<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kairav Dutta</title>
    <description>The latest articles on DEV Community by Kairav Dutta (@ka1rav6).</description>
    <link>https://dev.to/ka1rav6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4013891%2F2eade91e-9a72-41e1-bd20-52614e1b6264.jpg</url>
      <title>DEV Community: Kairav Dutta</title>
      <link>https://dev.to/ka1rav6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ka1rav6"/>
    <language>en</language>
    <item>
      <title>Why I Built Yet Another Logging Library</title>
      <dc:creator>Kairav Dutta</dc:creator>
      <pubDate>Fri, 03 Jul 2026 17:42:02 +0000</pubDate>
      <link>https://dev.to/ka1rav6/why-i-built-yet-another-logging-library-3okl</link>
      <guid>https://dev.to/ka1rav6/why-i-built-yet-another-logging-library-3okl</guid>
      <description>&lt;h1&gt;
  
  
  Why I Built Yet Another Logging Library
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Or, why I think logging should be as easy as &lt;code&gt;print()&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;If you've ever started a new project, you've probably written something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Server started&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Database connected&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eventually, you realize you want timestamps.&lt;/p&gt;

&lt;p&gt;Then colors.&lt;/p&gt;

&lt;p&gt;Then log levels.&lt;/p&gt;

&lt;p&gt;Then file logging.&lt;/p&gt;

&lt;p&gt;So you search for a logging library.&lt;/p&gt;

&lt;p&gt;You install it.&lt;/p&gt;

&lt;p&gt;Read the documentation.&lt;/p&gt;

&lt;p&gt;Configure it.&lt;/p&gt;

&lt;p&gt;And suddenly you've spent fifteen minutes setting up something that every project needs.&lt;/p&gt;

&lt;p&gt;That always bothered me.&lt;/p&gt;

&lt;p&gt;So I asked myself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What if logging was as easy as copying a single file into your project?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's why I built &lt;strong&gt;LogX&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Goal
&lt;/h1&gt;

&lt;p&gt;I wasn't trying to build another enterprise logging framework.&lt;/p&gt;

&lt;p&gt;There are already fantastic projects like &lt;strong&gt;spdlog&lt;/strong&gt;, &lt;strong&gt;Winston&lt;/strong&gt;, &lt;strong&gt;Pino&lt;/strong&gt;, &lt;strong&gt;Zap&lt;/strong&gt;, and many others that solve production-scale problems extremely well.&lt;/p&gt;

&lt;p&gt;My goal was much smaller.&lt;/p&gt;

&lt;p&gt;I wanted something that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;takes less than a minute to integrate&lt;/li&gt;
&lt;li&gt;has zero runtime dependencies&lt;/li&gt;
&lt;li&gt;works across multiple programming languages&lt;/li&gt;
&lt;li&gt;has a familiar API everywhere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Professional logging without the setup.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  What LogX Looks Like
&lt;/h1&gt;

&lt;p&gt;Instead of installing packages and reading configuration guides, the experience is intentionally simple.&lt;/p&gt;

&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;logx&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;

&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Server started&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Cache miss&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Database unavailable&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C++
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;"logx.hpp"&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Server started"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  TypeScript
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;logx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Server started&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is that if you know one language, the API feels familiar in the others.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Not Just Use &lt;code&gt;print()&lt;/code&gt;?
&lt;/h1&gt;

&lt;p&gt;Because after your project grows a little, &lt;code&gt;print()&lt;/code&gt; starts showing its limits.&lt;/p&gt;

&lt;p&gt;You usually want things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;timestamps&lt;/li&gt;
&lt;li&gt;colors&lt;/li&gt;
&lt;li&gt;log levels&lt;/li&gt;
&lt;li&gt;file logging&lt;/li&gt;
&lt;li&gt;cleaner formatting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But I also didn't want to pull in a large dependency just to get those basics.&lt;/p&gt;

&lt;p&gt;So LogX tries to sit in the middle.&lt;/p&gt;

&lt;p&gt;It gives you structured, readable logs while staying lightweight and requiring virtually no setup.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Philosophy
&lt;/h1&gt;

&lt;p&gt;One thing I noticed while working on this project is that many logging libraries are designed to solve problems that appear in very large systems.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;distributed tracing&lt;/li&gt;
&lt;li&gt;asynchronous pipelines&lt;/li&gt;
&lt;li&gt;log aggregation&lt;/li&gt;
&lt;li&gt;cloud transports&lt;/li&gt;
&lt;li&gt;observability platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are valuable features.&lt;/p&gt;

&lt;p&gt;They're also completely unnecessary for many projects.&lt;/p&gt;

&lt;p&gt;Sometimes you're writing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a CLI tool&lt;/li&gt;
&lt;li&gt;a game&lt;/li&gt;
&lt;li&gt;a college project&lt;/li&gt;
&lt;li&gt;a hackathon submission&lt;/li&gt;
&lt;li&gt;a prototype&lt;/li&gt;
&lt;li&gt;a personal utility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In those situations, I think logging should be simple.&lt;/p&gt;

&lt;p&gt;That's the niche LogX is trying to fill.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Multiple Languages?
&lt;/h1&gt;

&lt;p&gt;As I started using different programming languages more often, I realized I kept learning different logging APIs for every ecosystem.&lt;/p&gt;

&lt;p&gt;The concepts were always the same, but the syntax, configuration, and setup varied from language to language.&lt;/p&gt;

&lt;p&gt;I wanted one consistent experience.&lt;/p&gt;

&lt;p&gt;Whether you're writing C, C++, Python, TypeScript, or another supported language, the API should feel familiar.&lt;/p&gt;

&lt;p&gt;Learn it once.&lt;/p&gt;

&lt;p&gt;Use it everywhere.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Hardest Part Wasn't the Code
&lt;/h1&gt;

&lt;p&gt;Writing a logger isn't particularly difficult.&lt;/p&gt;

&lt;p&gt;The interesting challenge was designing an API that feels natural across multiple languages while remaining consistent.&lt;/p&gt;

&lt;p&gt;Python encourages one style.&lt;/p&gt;

&lt;p&gt;C++ encourages another.&lt;/p&gt;

&lt;p&gt;TypeScript has its own conventions.&lt;/p&gt;

&lt;p&gt;Finding the balance between "idiomatic" and "consistent" turned out to be far more interesting than implementing the logger itself.&lt;/p&gt;




&lt;h1&gt;
  
  
  What's Next
&lt;/h1&gt;

&lt;p&gt;I'm currently working on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;publishing LogX on language-specific package managers&lt;/li&gt;
&lt;li&gt;improving consistency across implementations&lt;/li&gt;
&lt;li&gt;expanding test coverage&lt;/li&gt;
&lt;li&gt;adding more examples&lt;/li&gt;
&lt;li&gt;benchmarking performance&lt;/li&gt;
&lt;li&gt;collecting feedback from developers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project is still evolving, and I'd genuinely appreciate suggestions.&lt;/p&gt;

&lt;p&gt;Especially if there's something in the API that feels awkward or unintuitive.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;I don't think every project needs a full logging framework.&lt;/p&gt;

&lt;p&gt;Sometimes you just want something you can drop into your project and immediately start using.&lt;/p&gt;

&lt;p&gt;That's the experience I wanted LogX to provide.&lt;/p&gt;

&lt;p&gt;If that sounds useful to you, I'd love to hear your thoughts.&lt;/p&gt;

&lt;p&gt;⭐ &lt;strong&gt;GitHub&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ka1rav6/logx" rel="noopener noreferrer"&gt;https://github.com/ka1rav6/logx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, criticism, feature requests, and pull requests are always welcome.&lt;/p&gt;

&lt;p&gt;If you end up using LogX in one of your projects, I'd love to hear about it!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
