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
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect-aws/powertools-logger

## Installation

  • 1.0.1
  • npm
  • Socket score

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

@effect-aws/powertools-logger

Installation

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

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 06 Feb 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