Log4s / log4s

High-performance SLF4J wrapper for Scala.
Other
171 stars 25 forks source link

Conflict with jsExports #23

Closed cquiroz closed 5 years ago

cquiroz commented 6 years ago

i'm having troubles with conflicts with JSExports using log4s. specifically with this line;

https://github.com/Log4s/log4s/blob/master/core/shared/src/main/scala/org/log4s/LogLevel.scala#L34

@JSExportTopLevel("Error")
case object Error extends LogLevel

names like Error are very common so you can easily conflict with other libraries. Why do you need to export this name?

sarahgerweck commented 6 years ago

@cquiroz I agree that this doesn't need to be a top-level export. I was making an effort to export enough that it would be reasonable to use Log4s from JavaScript native code and not only through Scala, but this was not intended.

cquiroz commented 6 years ago

This maybe solved by exporting log4s Objects as a module rather than to the global scope

sarahgerweck commented 6 years ago

@cquiroz agree completely: the exports were intended to be done this way.

cquiroz commented 6 years ago

Is this something you want to pursue or would you rather take a PR?

sarahgerweck commented 5 years ago

This is fixed in 1.7.0 by c7b64f3ee9d7e59a05d55625664222f0c13da9a6. It turned out to be a conflict with the way ScalaJS likes to deal with CommonJS modules vs the way it packages things up in applications. This forced a non-binary compatible change in the way Log4s works under ScalaJS, but I don't expect it to affect most applications.

cquiroz commented 5 years ago

Thanks. it works great on scala.js with 1.7.0