{"repo":"maraisr/diary","free":true,"listed":false,"github":"https://github.com/maraisr/diary","clone":"git clone https://github.com/maraisr/diary.git","description":"📑 Zero-dependency, fast logging library for Node, Browser and Workers","language":"TypeScript","stars":264,"topics":["fast","logging-library","logging","winston","pino","debug","middleware","cloudflare-workers","logger"],"license":"MIT","category":"analytics","readme_excerpt":"Dear diary, you make my logging so easy This is free to use software, but if you do like it, consider supporting me ❤️ ⚡ Features - No dependencies - Outstanding performance - Support for debug 's filter ⚙️ Install 🚀 Usage Node users The enable function is executed for you from the DEBUG environment variable. And as a drop-in replacement for debug . 🔎 API diary(name: string, onEmit?: Reporter) Returns: log functions A default diary is exported, accessible through simply importing any log function. Example of default diary name Type: string The name given to this diary —and will also be available in all logEvents. onEmit (optional) Type: Reporter A reporter is run on every log message (provided it's enabled). A reporter gets given the LogEvent interface: Note : you can attach any other context in middleware. Example For errors ( error and fatal ) there is also an error: Error property. log functions A set of functions that map to console.error , console.warn , console.debug , console.info and console.info . Aptly named: fatal , error , warn , debug , info , and log . All of which follow the same API signature: All parameters are simply spread onto the function and reported. Node/browser's built-in formatters will format any objects (by default). diary (optional) Type: Diary The result of calling diary; enable(query: string) Type: Function Opts certain log messages into being output. See more here. 💨 Benchmark via the /bench directory with Node v20.2.0 AOT: The logger is set","default_branch":null,"files":null,"tree":[],"storefront":"/r/maraisr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/maraisr/diary/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}