GithubHelp home page GithubHelp logo

sukovanej / effect-log Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 1.0 1.44 MB

Log batteries for effect-ts

Home Page: https://sukovanej.github.io/effect-log/

License: MIT License

TypeScript 78.23% JavaScript 21.77%
effect-ts fp-ts logging

effect-log's Introduction

effect-log

Logging batteris for effect-ts.

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

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

effect-log's People

Contributors

github-actions[bot] avatar renovate[bot] avatar sukovanej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rconjoe

effect-log's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/actions/setup/action.yml
  • pnpm/action-setup v2
  • actions/setup-node v4
.github/workflows/build.yml
  • actions/checkout v4
  • changesets/action v1
.github/workflows/check.yml
  • actions/checkout v4
.github/workflows/pages.yml
  • actions/checkout v4
  • actions/jekyll-build-pages v1
  • actions/upload-pages-artifact v2
  • actions/deploy-pages v2
.github/workflows/test.yml
  • actions/checkout v4
  • actions/checkout v4
  • oven-sh/setup-bun v1
npm
package.json
  • @babel/cli ^7.24.6
  • @babel/core ^7.24.6
  • @babel/plugin-transform-export-namespace-from ^7.24.6
  • @babel/plugin-transform-modules-commonjs ^7.24.6
  • @changesets/changelog-github ^0.5.0
  • @changesets/cli ^2.27.5
  • @effect/build-utils ^0.7.6
  • @effect/docgen ^0.4.3
  • @effect/eslint-plugin ^0.1.2
  • @effect/language-service ^0.1.0
  • @typescript-eslint/eslint-plugin ^7.12.0
  • @typescript-eslint/parser ^7.12.0
  • @vitest/coverage-v8 ^1.6.0
  • babel-plugin-annotate-pure-calls ^0.4.0
  • effect 3.2.8
  • eslint ^8.57.0
  • eslint-import-resolver-typescript ^3.6.1
  • eslint-plugin-codegen 0.28.0
  • eslint-plugin-deprecation ^3.0.0
  • eslint-plugin-import ^2.29.1
  • eslint-plugin-simple-import-sort ^12.1.0
  • eslint-plugin-sort-destructure-keys ^2.0.0
  • madge ^7.0.0
  • prettier ^3.3.0
  • rimraf ^5.0.7
  • tsx ^4.11.2
  • typescript ^5.4.5
  • vite ^5.2.12
  • vitest ^1.6.0
  • effect ^3.2.0
  • pnpm 9.1.4

  • Check this box to trigger a request for Renovate to run again on this repository

Feature request: support for winston

Winston would be a useful addition to this set of loggers. Especially considering its support for and ecosystem of remote loggers like files, dbs, third party services like logtail,, etc. I would be willing to create a PR, but I'm wondering if there is interest in adding support for this to this lib or whether it might be better to make this a separate lib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.