cozylogwriter

Cozy Log Writer

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.0
License GPL-2.0-or-later
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Authors

  • Kirill I

Installation

nimble install cozylogwriter
choosenim install cozylogwriter
git clone https://github.com/indiscipline/cozylogwriter

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
cozylogwriter - - - - - - -

Dependencies

Package Version Optional
nim >= 2.0.0 No

Source

Repository https://github.com/indiscipline/cozylogwriter
Homepage https://github.com/indiscipline/cozylogwriter
Registry Source nimble_official

README

Cozy Log Writer

License: GPL v2

Cozy Log Writer is a basic logging module for Nim programs. It automatically uses a styled or plain text format depending on whether the output file is a terminal or not. The module also reads and respects the NO_COLOR environment variable by default.

Features

  • Supports different log levels: log, info, warn, err, panic
  • Styled output with colours and UTF icons for terminal output
  • Plain text output for non-terminal output
  • Respects the NO_COLOR environment variable (unless compiled with -d:ClwIgnoreNocolor)

Installation

Cozy Log Writer is not yet the nimble directory, git clone or just download the module.

Upon acceptance in the nimble directory, use atlas or nimble to install:

atlas use cozytaskpool
nimble install cozytaskpool

Usage

import pkg/cozylogwriter

# Initialize the logger with stderr as the output file
newCozyLogWriter(stderr)

log("This is a log message", (complex: "types", are: "stringified", n: 42))
info("This is an info message")
warn("This is a warning message")
err("This is an error message")
panic("This is a panic message") # Exits the program with code 1
panicWithCode(QuitSuccess, "This is a panic message") # Exits the program with a given code

[!WARNING] The logger uses a global object internally and is not thread-safe. The module does not prevent or manage concurrent access in any way.

Documentation

Documentation is included. You can generate it locally with nim doc cozylogwriter.nim.

License

Cozy Log Writer is licensed under GNU General Public License version 2.0 or later. See the LICENSE file for details.