# @qui-cli/log

> @qui-cli Plugin: Standardized winston wrapper

Latest version **4.0.5** (published 2026-08-01) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @qui-cli/log
pnpm add @qui-cli/log
yarn add @qui-cli/log
bun add @qui-cli/log
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.5 |
| Published | 2026-08-01 |
| First published | 2025-08-02 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 52.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Seth Battis |
| Maintainers | battis |

## Links

- npm: https://www.npmjs.com/package/@qui-cli/log
- Repository: https://github.com/battis/qui-cli
- Homepage: https://github.com/battis/qui-cli/tree/main/packages/log#readme
- npm.io page: https://npm.io/package/@qui-cli/log

## Dependencies (3)

- [ora](https://npm.io/package/ora.md) ^9.4.1
- [winston](https://npm.io/package/winston.md) ^3.19.0
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^7.2.0

## Recent versions

- 4.0.5 (latest) — 2026-08-01
- 4.0.5-0 (prerelease) — 2026-07-08
- 4.0.4 — 2026-03-10
- 4.0.3 — 2026-01-18
- 4.0.2 — 2026-01-02
- 4.0.1 — 2025-11-12
- 4.0.0 — 2025-11-07
- 3.1.0 — 2025-11-04
- 3.0.1 — 2025-08-04
- 3.0.0 — 2025-08-02

## README

# @qui-cli/log

@qui-cli Plugin: Standardized winston wrapper

[![npm version](https://badge.fury.io/js/@qui-cli%2Flog.svg)](https://npmjs.com/package/@qui-cli/log)
[![Module type: ESM](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://nodejs.org/api/esm.html)

## Install

```sh
npm install @qui-cli/log @qui-cli/core
```

If developing a reusable plugin:

```sh
npm install --save-peer  @qui-cli/log@>=3.2
```

## Usage

```ts
import { Log } from '@qui-cli/log';
import { Core } from '@qui-cli/core';

// process user-provided command-line arguments
const args = await Core.run();

// use Log
Log.debug(args);
```

## Configuration

```ts
export type Configuration = Plugin.Configuration & {
  logFilePath?: string;
  stdoutLevel?: string;
  fileLevel?: string;
  levels?: CustomLevels;
  root?: string;
};
```

### `logFilePath`

Optional path to log file (relative to `root`).

### `stdoutLevel`

Log level to display via stdout/console, defaults to `'info'`;

### `fileLevel`

Log level to write to log file (if `logFilePath` defined), defaults to `'all'`;

### `levels`

Custom log levels to use, specified by `Log.CustomLevels`

### `root`

Optional root to use as the base for relative `logFilePath`. If undefined, falls back to the path defined by [@qui-cli/root](https://www.npmjs.com/package/@qui-cli/root).

## Options

Exposes `logFilePath`, `stdoutLevel`, and `fileLevel` to user-provided command line arguments.

## Initialization

`Log` will updating logging settings after user-provided command line arguments are parsed. If `stdoutLevel` is set to `off`, logging to the console will be disabled. If `configure()` has provided a `logFilePath` value previously and the user provides an additional `logFilePath`, logs will be written to both paths.

## API

```ts
import { Log } from '@qui-cli/log';
```

### `Log.get(): winston.Logger`

Get the actual winston logger object.

### `Log.log()`

Directly invoke the winston [`log()` method](https://www.npmjs.com/package/winston#user-content-usage)

### `Log.trace()`, `Log.debug()`, `Log.info()`, `Log.warning()`, `Log.error()`, `Log.fatal()`

Log a string or object (to be stringified -- in color in the console) at the respective log level.

---
_Source: https://npm.io/package/@qui-cli/log · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
