Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@effect-aws/powertools-logger

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect-aws/powertools-logger

[![npm version](https://img.shields.io/npm/v/%40effect-aws%2Fpowertools-logger?color=brightgreen&label=npm%20package)](https://www.npmjs.com/package/@effect-aws/powertools-logger) [![npm downloads](https://img.shields.io/npm/dm/%40effect-aws%2Fpowertools-

  • 1.4.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
41K
decreased by-6.1%
Maintainers
0
Weekly downloads
 
Created
Source

@effect-aws/powertools-logger

npm version npm downloads

Installation

npm install --save @effect-aws/powertools-logger @aws-lambda-powertools/logger

Note: @aws-lambda-powertools/logger is a peer dependency and package supports v1.9.0 and higher.

Usage

With default PowerTools Logger instance:

import { pipe } from "effect/Function";
import * as Effect from "effect/Effect";
import * as Logger from "@effect-aws/powertools-logger";

const program = pipe(
  Logger.logInfo("Info message with log meta", { foo: "bar" }),
  Effect.tap(() => Effect.logInfo("Native effect info message")),
);

const result = pipe(
  program,
  Effect.provide(Logger.DefaultPowerToolsLoggerLayer),
  Effect.runPromise,
);

With custom PowerTools Logger options:

import { pipe } from "effect/Function";
import * as Effect from "effect/Effect";
import * as Logger from "@effect-aws/powertools-logger";

const program = pipe(
  Logger.logDebug("Debug message with log meta", { foo: "bar" }),
  Effect.tap(() => Effect.logDebug("Native effect debug message")),
);

const result = pipe(
  program,
  Effect.provide(Logger.PowerToolsLoggerLayer),
  Effect.provideService(Logger.LoggerOptions, { logLevel: "DEBUG" }),
  Effect.runPromise,
);

With custom PowerTools Logger instance:

import { Logger as LoggerCtor } from "@aws-lambda-powertools/logger";
import { pipe } from "effect/Function";
import * as Effect from "effect/Effect";
import * as Logger from "@effect-aws/powertools-logger";

const program = pipe(
  Logger.logDebug("Debug message with log meta", { foo: "bar" }),
  Effect.tap(() => Effect.logDebug("Native effect debug message")),
);

const result = pipe(
  program,
  Effect.provide(Logger.BasePowerToolsLoggerLayer),
  Effect.provideService(
    Logger.LoggerInstance,
    new LoggerCtor({ logLevel: "DEBUG" }),
  ),
  Effect.runPromise,
);

FAQs

Package last updated on 31 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc