GithubHelp home page GithubHelp logo

grizzled-slf4j's Introduction

bmc

Just some quick details:

Other links are in my GitHub profile.

grizzled-slf4j's People

Contributors

bmc avatar deaktator avatar hakujin avatar hsn10 avatar lucastorri avatar retronym avatar rossabaker avatar sullis avatar takezoe avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grizzled-slf4j's Issues

apply[T](implicit manifest) to Logger object

I would suggest to added a new apply method to Logger object like:

def apply[T](implicit m: Manifest[T]): Logger = apply(m.erasure)

So one would use:

val logger = Logger[MyClass]

Inline optimization warning

I'm receiving the following warning when compiling with "scalac -optimise". I don't think its due to my usage, though.

This is with v0.6.6 and Scala 2.9.1

[WARNING] Foo.scala:101: warning: Could not inline required method warn because it is unsafe (target may reference private fields).
[WARNING] log.warn("Fake log message ")

Remove `()` in `Logger.apply[C: ClassTag]()` method?

The Scala 2.13.3 deprecates auto-application of (non-Java-defined) methods with a single empty parameter list: scala/scala#8833.

So the below example in the documentation doesn't work anymore (without suppressing the warning):

class Foo {
  val logger = Logger[this.type] // or Logger[Foo]
}

Would it better to remove the () in Logger.apply[C: ClassTag]() method here:
https://github.com/bmc/grizzled-slf4j/blob/master/src/main/scala/grizzled/slf4j/slf4j.scala#L434 ?
Then we could still use Logger[this.type] in our code.

Using logger in a Serializable class

Is there a recommended way to use a grizzled.slf4j.Logger in a Serializable class?

I'm currently mixing in Logging to my class and getting serialization errors due to the non-serializable _logger member:

[info]   Cause: java.io.NotSerializableException: grizzled.slf4j.Logger
[info] Serialization stack:
[info] 	- object not serializable (class: grizzled.slf4j.Logger, value: grizzled.slf4j.Logger@19c58b6)
[info] 	- field (class: org.my_group.my_class, name: grizzled$slf4j$Logging$$_logger, type: class grizzled.slf4j.Logger)
[info] 	- object (class org.my_group.my_class, DepthMap(MapPartitionsRDD[27] at map at DepthMap.scala:149))
…

This is in the context of a Spark application that is serializing a task closure, fwiw.

This SO has general discussion about this kind of issue but nothing that will specifically unstick me here, afaict.

Split into API and implementation

Split the API into two parts:

  • A set of API traits, which are logging framework-agnostic.
  • An SLF4J implementation of those traits.

Allows alternate implementations (e.g., on CLR) that aren't tied to SLF4J.

version 1.0.1 depends on scala-library 2.10.0-RC1 in compile scope

I'm a Scalatra user and Scalatra depends on this library. The latest stable version 1.0.1 seems to depend on scala-library 2.10.0-RC1 in compile scope.

http://search.maven.org/remotecontent?filepath=org/clapper/grizzled-slf4j_2.10/1.0.1/grizzled-slf4j_2.10-1.0.1.pom

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.0-RC1</version>
<scope>compile</scope>
</dependency>

Actually it's not a big problem, but ideally this dependency is not needed. Do you have any plans to release new version?

make slf4j-api "optional"

Can you make the slf4j-api dependence in build.sbt "optional" rather than none/?

Otherwise, things like the sbt web plugin are going to stuff the library into wars they create and that's going to play havoc with servlet container class loaders which will find it both at the webapp and server level and not be happy.

Unless, of course, there's a better way to fix this ...

is there warn(somOperation) which returns the someOperation result in case its None?

for example I have this
for {
user <- UserRepository.findById(1) // do you ever need to log warning here if None? what is your best practice for it here?
gender <- user.gender
} yield gender // results in Some("male")

I thought of using something like

user <- warnIfNeeded(UserRepository.findById(1))

now instead of writing my own warnIfNeeded would be great to have it in a shared lib... what do you think?

Logging fails with Scala 2.10.0 Final

When used with 2.10.0 all logging calls fail to instantiate a logger with a java.lang.NoClassDefFoundError: scala/reflect/ClassManifest thrown from the call to getClass in the logger initialisation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.