scalajs-logging


License

License

Categories

Categories

JavaScript Languages Scala Logging Application Layer Libs
GroupId

GroupId

org.scala-js
ArtifactId

ArtifactId

scalajs-logging_2.12
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

scalajs-logging
scalajs-logging
Project URL

Project URL

https://github.com/scala-js/scala-js-logging
Project Organization

Project Organization

org.scala-js
Source Code Management

Source Code Management

https://github.com/scala-js/scala-js-logging

Download scalajs-logging_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/org.scala-js/scalajs-logging_2.12/ -->
<dependency>
    <groupId>org.scala-js</groupId>
    <artifactId>scalajs-logging_2.12</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.scala-js/scalajs-logging_2.12/
implementation 'org.scala-js:scalajs-logging_2.12:1.1.1'
// https://jarcasting.com/artifacts/org.scala-js/scalajs-logging_2.12/
implementation ("org.scala-js:scalajs-logging_2.12:1.1.1")
'org.scala-js:scalajs-logging_2.12:jar:1.1.1'
<dependency org="org.scala-js" name="scalajs-logging_2.12" rev="1.1.1">
  <artifact name="scalajs-logging_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.scala-js', module='scalajs-logging_2.12', version='1.1.1')
)
libraryDependencies += "org.scala-js" % "scalajs-logging_2.12" % "1.1.1"
[org.scala-js/scalajs-logging_2.12 "1.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.11

Project Modules

There are no modules declared in this project.

scalajs-logging

scalajs-logging is a tiny logging API for use by the Scala.js linker and JS environments. It is not a general-purpose logging library, and you should probably not use it other than to interface with the Scala.js linker API and the JSEnv API.

Setup

Normally you should receive the dependency on scalajs-logging through scalajs-linker or scalajs-js-envs. If you really want to use it somewhere else, add the following line to your settings:

libraryDependencies += "org.scala-js" %% "scalajs-logging" % "1.1.1"

Usage

import org.scalajs.logging._

// get a logger that discards all logs
val logger = NullLogger // discard all logs

// or get a logger that prints all logs of severity Warn and above to the console
val logger = new ScalaConsoleLogger(Level.Error)

// or create your own Logger:
val logger = new Logger {
  def log(level: Level, message: => String): Unit = ???
  def trace(t: => Throwable): Unit = ???
}

then give your logger instance to an API.

Available severity levels are Debug, Info, Warn and Error.

For more details, consult the Scaladoc of scalajs-logging.

org.scala-js

Scala.js

Versions

Version
1.1.1
1.1.0
1.0.1
1.0.0
1.0.0-RC2
1.0.0-RC1
1.0.0-M8
1.0.0-M7
1.0.0-M6
1.0.0-M5
1.0.0-M4
1.0.0-M3