Skip to content

Commit

Permalink
Use slf4j logger
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseydew committed Apr 25, 2024
1 parent c871f7c commit 7738002
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ val commonSettings: immutable.Seq[Def.Setting[_]] = List(
case PathList(ps @ _*) if ps.last equalsIgnoreCase "Log4j2Plugins.dat" => sbtassembly.Log4j2MergeStrategy.plugincache
case _ => MergeStrategy.first
},
// dependencyOverrides ++= Seq(
//// commonsLogging,
//// slf4jApi,
//
// ),
organization := "com.gu",
version := "1.0",
scalaVersion := "2.12.19",
Expand Down
5 changes: 3 additions & 2 deletions common/src/main/scala/com/gu/sfl/Logging.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.gu.sfl

import org.apache.logging.log4j.LogManager
import org.slf4j.Logger
import org.slf4j.LoggerFactory

import scala.util.{Failure, Success, Try}

trait Logging {
val logger = LogManager.getLogger(this.getClass.getName)
val logger: Logger = LoggerFactory.getLogger(this.getClass.getName)

def logOnThrown[T](function: () => T, messageOnError: String = ""): T = Try(function()) match {
case Success(value) => value
Expand Down

0 comments on commit 7738002

Please sign in to comment.