diff --git a/README.md b/README.md index 137cb2b18..52ce26e97 100644 --- a/README.md +++ b/README.md @@ -26,19 +26,19 @@ For people that want to skip the explanations and see it action, this is the pla ### Dependency Configuration ```scala -libraryDependencies += "com.outr" %% "scribe" % "3.12.0" +libraryDependencies += "com.outr" %% "scribe" % "3.12.1" ``` For Cross-Platform projects (JVM, JS, and/or Native): ```scala -libraryDependencies += "com.outr" %%% "scribe" % "3.12.0" +libraryDependencies += "com.outr" %%% "scribe" % "3.12.1" ``` Or, if you want interoperability with SLF4J (to allow better interoperability with existing libraries using other loggers): ```scala -libraryDependencies += "com.outr" %% "scribe-slf4j" % "3.12.0" +libraryDependencies += "com.outr" %% "scribe-slf4j" % "3.12.1" ``` ### Usage diff --git a/build.sbt b/build.sbt index 89d65b360..fb5eb4119 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ val allScalaVersions = List(scala213, scala212, scala3) name := "scribe" ThisBuild / organization := "com.outr" -ThisBuild / version := "3.12.0" +ThisBuild / version := "3.12.1" ThisBuild / scalaVersion := scala213 ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation") ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8") diff --git a/core/shared/src/main/scala/scribe/package.scala b/core/shared/src/main/scala/scribe/package.scala index 4d9084ffc..9e3a49dc1 100644 --- a/core/shared/src/main/scala/scribe/package.scala +++ b/core/shared/src/main/scala/scribe/package.scala @@ -30,6 +30,13 @@ package object scribe extends LoggerSupport[Unit] { */ def data(key: String, value: => Any): LogFeature = LogFeature(_(key) = () => value) + /** + * LogFeature convenience functionality to set a map of data on a log + */ + def data(map: Map[String, Any]): LogFeature = LogFeature { r => + map.foldLeft(r)((record, tuple) => record(tuple._1) = () => tuple._2) + } + /** * LogFeature convenience functionality to set a booster on a log */