Skip to content
Skills Library
Programming · Learning & explanation

workleap-logging

/workleap-logging

Guide for @workleap/logging, a structured logging library for Workleap frontend TypeScript applications. Use this skill when: (1) Setting up or configuring @workleap/logging loggers (BrowserConsoleLogger, CompositeLogger) (2) Using @workleap/logging API: log levels, chained segments, scopes, styled output (3) Composing or filtering @workleap/logging loggers for multi-destination logging (4) Integrating @workleap/logging with LogRocket via CompositeLogger (5) Reviewing PRs or troubleshooting @workleap/logging usage

Repository
wl-squide ↗
Licence
Apache-2.0
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Guide for @workleap/logging, a structured logging library for Workleap frontend TypeScript applications. Use this skill when: (1) Setting up or configuring @workleap/logging loggers (BrowserConsoleLogger, CompositeLogger) (2) Using @workleap/logging API: log levels, chained segments, scopes, styled output (3) Composing or filtering @workleap/logging loggers for multi-destination logging (4) Integrating @workleap/logging with LogRocket via CompositeLogger (5) Reviewing PRs or troubleshooting @workleap/logging usage

Original author description

Guide for @workleap/logging, a structured logging library for Workleap frontend TypeScript applications. Use this skill when: (1) Setting up or configuring @workleap/logging loggers (BrowserConsoleLogger, CompositeLogger) (2) Using @workleap/logging API: log levels, chained segments, scopes, styled output (3) Composing or filtering @workleap/logging loggers for multi-destination logging (4) Integrating @workleap/logging with LogRocket via CompositeLogger (5) Reviewing PRs or troubleshooting @workleap/logging usage

How it works

  1. Installation
  2. Core Concepts
  3. Chained Segments
  4. Common Mistakes
  5. Reference Guide
Original SKILL.md headings · 66 lines, 345 words
SKILL.md preview
---
name: workleap-logging
description: |
  Guide for @workleap/logging, a structured logging library for Workleap frontend TypeScript applications.

  Use this skill when:
  (1) Setting up or configuring @workleap/logging loggers (BrowserConsoleLogger, CompositeLogger)
  (2) Using @workleap/logging API: log levels, chained segments, scopes, styled output
  (3) Composing or filtering @workleap/logging loggers for multi-destination logging
  (4) Integrating @workleap/logging with LogRocket via CompositeLogger
  (5) Reviewing PRs or troubleshooting @workleap/logging usage
metadata:
  version: 1.2
---

# Workleap Logging (@workleap/logging)

A structured logging library for Workleap frontend applications. Provides composable, styled console logging with support for scopes, multiple log levels, and integration with telemetry tools.

## Installation

```bash
pnpm add @workleap/logging
```

## Core Concepts

### Loggers
- **BrowserConsoleLogger**: Outputs to browser console with styling support
- **CompositeLogger**: Forwards logs to multiple underlying loggers

### Log Levels (lowest to highest severity)
1. `debug` - Detailed diagnostic info for development
2. `information` - General application flow events
3. `warning` - Non-critical issues needing attention
4. `error` - Failures preventing functionality
5. `critical` - Severe errors risking data integrity

### Scopes
Group related log entries under a label. Useful for tracing operations or correlating events.

**IMPORTANT:** Only a `RootLogger` instance can start a scope. If the logger is typed as a `Logger` (e.g., when using `useLogger()` from Squide), you must cast it to `RootLogger` before starting a scope:

```ts
// Squide example:
import { useLogger } from "@squide/firefly";
import type { RootLogger } from "@workleap/logging";

const logger = useLogger();
(logger as RootLogger).startScope("User signup");
```

## Chained Segments

Build complex log entries by chaining segments. **Always complete the chain with a log level method** (`.debug()`, `.error()`, etc.) or nothing is output.

```ts
logger
    .withText("Processing order")
    .withObject({ orderId: 123 })
    .withError(new Error("Failed"))
    .error();
```

## Common Mistakes

1. **Forgetting to call log method**: Chained segments require `.debug()`, `.error()`, etc. to output
2. **Not ending scopes**: Always call `scope.end()` or logs won't output
3. **Using wrong log level**: Use `error` for failures, not `warning`
4. **Logging sensitive data**: Never log passwords, tokens, or PII
5. **Missing error context**: Always include `withObject()` for relevant data and `withError()` for exceptions
6. **Calling startScope on a non-RootLogger**: Only `RootLogger` instances can start scopes. When using `useLogger()` from Squide, cast to `RootLogger` first: `(logger as RootLogger).startScope("Label")`

## Reference Guide

For detailed documentation beyond the patterns above, consult:

- **`references/api.md`** — Logger constructors, all methods (styled text, line breaks), scope API, createCompositeLogger, log level guidelines
- **`references/patterns.md`** — Common patterns (app setup, error logging, scoping, multi-destination), LogRocket integration, PR review checklist
Files in this package (3)
  • SKILL.md 3 KB
  • references/api.md 2 KB
  • references/patterns.md 3 KB

Versions

The database has no other skills named workleap-logging.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version f6ec550c32ce (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100workleap-telemetry
    Guide for @workleap/telemetry, Workleap's unified telemetry connecting Honeycomb, LogRocket, and Mixpanel with automatic correlation IDs. Use this skill when: (1) Initializing wl-telemetry in a frontend application (2) Correlation values (Telemetry Id, Device Id) and cross-tool…
  • 100workleap-eslint-configs
    Workleap's shared ESLint 9 flat configs (`@workleap/eslint-configs`): `defineWebApplicationConfig`, `defineReactLibraryConfig`, `defineTypeScriptLibraryConfig`, and `defineMonorepoWorkspaceConfig`. Use when installing, configuring, customizing (rules, plugins, ignores, Jest vs…
  • 100workleap-typescript-configs
    Workleap's shared TypeScript configs (`@workleap/typescript-configs`): `web-application.json`, `library.json`, `monorepo-workspace.json`, and the `core.json` / `react.json` composition pieces. Use when creating or editing a `tsconfig.json` in a project that uses…
  • 100workleap-squide
    Squide (@squide/firefly) — Workleap's React modular application shell. Use when: (1) Working with FireflyRuntime, initializeFirefly, AppRouter, or FireflyProvider (2) Creating or modifying Squide host applications or modules (3) Registering routes, navigation items, or MSW…
  • 85logtape
    Use this skill when writing any code that uses LogTape for logging in JavaScript or TypeScript. Covers getting loggers, the structured message syntax, configuration, library author rules, context, lazy evaluation, testing, and common mistakes to avoid. Trigger whenever the user…
  • 100logging-standards
    Structured logging standards: log levels, structured fields, correlation IDs, PII masking, and event naming. TRIGGER when: adding log statements, configuring loggers, or reviewing log output. SKIP: metrics and alerting (use monitoring-observability); error control flow (use…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.