<commit_before>package blended.util.logging

import java.util.{ logging => jul }

import scala.reflect.ClassTag

import org.slf4j

trait Logger extends Serializable {

  def isErrorEnabled: Boolean = false
  def isWarnEnabled: Boolean = false
  def isInfoEnabled: Boolean = false
  def isDebugEnabled: Boolean = false
  def isTraceEnabled: Boolean = false

  def error(msg: => String): Unit = {}
  def warn(msg: => String): Unit = {}
  def info(msg: => String): Unit = {}
  def debug(msg: => String): Unit = {}
  def trace(msg: => String): Unit = {}

  def error(e: Throwable)(msg: => String): Unit = {}
  def warn(e: Throwable)(msg: => String): Unit = {}
  def info(e: Throwable)(msg: => String): Unit = {}
  def debug(e: Throwable)(msg: => String): Unit = {}
  def trace(e: Throwable)(msg: => String): Unit = {}

}

object Logger {
  def apply[T: ClassTag]: Logger = {
    val base = scala.reflect.classTag[T].runtimeClass.getName
    try {
      // we expect class loading errors if no slf4j is present
      new LoggerSlf4j(slf4j.LoggerFactory.getLogger(base))
    } catch {
      case _: NoClassDefFoundError | _: ClassNotFoundException =>
        try {
          // fall back to jul
          new LoggerJul(jul.Logger.getLogger(base))
        } catch {
          case _: NoClassDefFoundError | _: ClassNotFoundException =>
            new LoggerNoOp()
        }
    }
  }
}

class LoggerNoOp() extends Logger

    
    
    <commit_msg>Added alternative apply method to Logger acepting a name : String<commit_after>package blended.util.logging

import java.util.{ logging => jul }

import scala.reflect.ClassTag

import org.slf4j

trait Logger extends Serializable {

  def isErrorEnabled: Boolean = false
  def isWarnEnabled: Boolean = false
  def isInfoEnabled: Boolean = false
  def isDebugEnabled: Boolean = false
  def isTraceEnabled: Boolean = false

  def error(msg: => String): Unit = {}
  def warn(msg: => String): Unit = {}
  def info(msg: => String): Unit = {}
  def debug(msg: => String): Unit = {}
  def trace(msg: => String): Unit = {}

  def error(e: Throwable)(msg: => String): Unit = {}
  def warn(e: Throwable)(msg: => String): Unit = {}
  def info(e: Throwable)(msg: => String): Unit = {}
  def debug(e: Throwable)(msg: => String): Unit = {}
  def trace(e: Throwable)(msg: => String): Unit = {}

}

object Logger {
  def apply[T: ClassTag]: Logger = {
    val name = scala.reflect.classTag[T].runtimeClass.getName
    apply(name)
  }

  def apply(name: String): Logger = {
    try {
      // we expect class loading errors if no slf4j is present
      new LoggerSlf4j(slf4j.LoggerFactory.getLogger(name))
    } catch {
      case _: NoClassDefFoundError | _: ClassNotFoundException =>
        try {
          // fall back to jul
          new LoggerJul(jul.Logger.getLogger(name))
        } catch {
          case _: NoClassDefFoundError | _: ClassNotFoundException =>
            new LoggerNoOp()
        }
    }
  }
}

class LoggerNoOp() extends Logger

    
    
    
{'fraction_non_alphanumeric': 0.12687813021702837, 'fraction_numerical': 0.002671118530884808, 'mean_word_length': 2.973474801061008, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1373866', 'n_tokens_mistral': 935, 'n_tokens_neox': 925, 'n_words': 258}