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

org.novelfs:pure-log_2.11

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.novelfs:pure-log_2.11

pure-log

  • 0.3.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

pure-log

Build Status Latest version

Simple logging in IO

libraryDependencies += "org.novelfs" %% "pure-log" % "[Latest version]"

Works in any Applicative with a LiftIO instance.

import org.novelfs.pure.log.Logger
import org.novelfs.pure.log.simple._
import cats.effect.IO

Logger.log[IO](LogLevel.Info)("Hello World!").unsafeRunSync()

MDC Logging

Works in any Monad with a LiftIO instance and an ApplicativeLocal instance where the environment that you intend to read from has a ToMdc instance.

import org.novelfs.pure.log.Logger
import org.novelfs.pure.log.mdc._
import cats.data.ReaderT
import cats.mtl.implicits._

case class Captain(firstName : String, lastName : String)

implicit val captainToMdc = new ToMdc[Captain] {
  override def toMdc(captain: Captain): Map[String, String] = Map("firstName" -> captain.firstName, "lastName" -> captain.lastName)
}

Logger.log[ReaderT[IO, Captain, ?]](LogLevel.Info)("Hello World!")
  .run(Captain("James", "Kirk"))
  .unsafeRunSync()

FAQs

Package last updated on 06 Mar 2019

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