Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

workleap-logging

/workleap-logging

Prowadzi przez bibliotekę @workleap/logging do strukturalnego logowania we frontendach TypeScript: poziomy, zakresy i połączone loggery.

Repozytorium
wl-squide ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

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

Co robi i kiedy

Prowadzi przez bibliotekę @workleap/logging do strukturalnego logowania we frontendach TypeScript: poziomy, zakresy i połączone loggery.

Oryginalny opis (EN)

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

Jak działa

  1. Installation
  2. Core Concepts
  3. Chained Segments
  4. Common Mistakes
  5. Reference Guide
Sekcje z nagłówków SKILL.md, w oryginale · 66 linii, 345 słów
Podgląd SKILL.md
---
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
Pliki w paczce (3)
  • SKILL.md 3 KB
  • references/api.md 2 KB
  • references/patterns.md 3 KB

Wersje

W bazie nie ma innych skilli o nazwie workleap-logging.

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki f6ec550c32ce (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100workleap-telemetry
    Prowadzi przez @workleap/telemetry, który łączy Honeycomb, LogRocket i Mixpanel z automatycznymi identyfikatorami korelacji.
  • 100workleap-eslint-configs
    Konfiguruje ESLint 9 przez współdzielone konfiguracje Workleap: aplikacje webowe, biblioteki React, biblioteki TypeScript i monorepo.
  • 100workleap-typescript-configs
    Pomaga w plikach tsconfig.json przy współdzielonych konfiguracjach TypeScript Workleap, także przy migracji typecheckingu do tsgo.
  • 100workleap-squide
    Pomaga tworzyć aplikacje hosta i moduły w Squide, czyli powłoce React Workleap: trasy, pozycje nawigacji i handlery MSW.
  • 85logtape
    Pomaga pisać logowanie w JavaScript i TypeScript przy użyciu LogTape: loggery, strukturalne komunikaty, konfigurację i typowe błędy.
  • 100logging-standards
    Ustala standardy ustrukturyzowanego logowania: poziomy, pola strukturalne, identyfikatory korelacji, maskowanie danych osobowych i nazewnictwo zdarzeń, z przykładami w structlog i ujściem OTLP.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.