New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

effect-log

Package Overview
Dependencies
Maintainers
0
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effect-log

Logging batteris for effect-ts

Source
npmnpm
Version
0.31.5
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

effect-log

Logging batteris for effect-ts.

Pretty logger

Use PrettyLogger.make to create the pretty logger or PrettyLogger.layer to obtain a layer replacing the default logger. Optionally, these functions accept an options object configuring what information gets to the output.

import { Effect, pipe } from "effect";
import { PrettyLog } from "effect-log";

import { exampleEffect } from "./example-logging-effect";

// These are the defaults. You can omit the argument
// completely if you're okay with the defaults.
const logger = PrettyLog.layer({
  showFiberId: true,
  showTime: true,
  showSpans: true,
  enableColors: true,
});

pipe(exampleEffect, Effect.provide(logger), Effect.runSync);

pretty

JSON logger

Use JsonLogger.make to create the JSON logger or JsonLogger.layer to obtain a layer replacing the default loggger. Optionally, these functions accept an options object configuring what information gets to the output.

import { Effect, pipe } from "effect";
import { JsonLogger } from "effect-log";

import { exampleEffect } from "./example-logging-effect";

// These are the defaults. You can omit the argument
// completely if you're okay with the defaults.
const logger = JsonLogger.layer({
  showFiberId: true,
  showTime: true,
  showSpans: true,
  messageField: "message",
});

pipe(exampleEffect, Effect.provide(logger), Effect.runSync);

json

FAQs

Package last updated on 21 Jun 2024

Related posts