{"repo":"khmm12/knex-tiny-logger","free":true,"listed":false,"github":"https://github.com/khmm12/knex-tiny-logger","clone":"git clone https://github.com/khmm12/knex-tiny-logger.git","description":"Zero-config query logging for Knex. Tiny by default, flexible when needed.","language":"TypeScript","stars":30,"topics":["knex","debug","logger","javascript","logging","nodejs","knexjs","sql-logger","tracing","typescript"],"license":"MIT","category":"analytics","readme_excerpt":"knex-tiny-logger Zero-config query logging for Knex. Tiny by default, flexible when needed. Install Requires Node.js 20 or newer. Bun 1.3 or newer is also supported. Usage By default, knexTinyLogger uses defaultLogger : plain string logs, no extra runtime dependencies. Default Logger The default logger formats SQL before writing it. By default, it asks Knex to interpolate bindings into the logged SQL. Set bindings: false to write the original SQL with placeholders, or replace formatting completely: The built-in formatter is also exported if you want the same SQL formatting in a custom logger: write can be a function or a stream-like target: Colorful Logs The colorful logger is the same string logger experience, with output colored by query state. It supports the same bindings , formatter , and write options as defaultLogger , and has no extra runtime dependencies. By default the whole message is colored by state: the SQL / SQL ERROR label and the SQL body are cyan for successful queries and red for failed ones. Syntax highlighting Set highlight: true to syntax-highlight the SQL body instead. The label still carries the query state (cyan or red); the body's tokens are colored by an ANSI theme. formatter , when provided, controls the SQL string before highlighting is applied. Themes colorfulSyntaxThemes.default is used when no theme is given. It's a 16-color ANSI theme that adapts to your terminal's palette, so it works everywhere. The named themes are fixed 24-bit truecolor an","default_branch":null,"files":null,"tree":[],"storefront":"/r/khmm12","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/khmm12/knex-tiny-logger/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."}