Skip to content

Commit 544607a

Browse files
author
Mathias Bogaert
committed
Add override to remove in iterator for dummy marker.
1 parent ca7549e commit 544607a

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

src/main/scala/com/typesafe/scalalogging/Logger.scala

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.typesafe.scalalogging
1818

19-
import org.slf4j.{LoggerFactory, Marker, Logger => Underlying}
19+
import org.slf4j.{ LoggerFactory, Marker, Logger => Underlying }
2020

2121
import scala.reflect.ClassTag
2222

@@ -31,12 +31,13 @@ object Logger {
3131
def apply(underlying: Underlying): Logger =
3232
new Logger(underlying)
3333

34-
/** Create a [[Logger]] for the given name.
35-
* Example:
36-
* {{{
37-
* val logger = Logger("application")
38-
* }}}
39-
*/
34+
/**
35+
* Create a [[Logger]] for the given name.
36+
* Example:
37+
* {{{
38+
* val logger = Logger("application")
39+
* }}}
40+
*/
4041
def apply(name: String): Logger =
4142
new Logger(LoggerFactory.getLogger(name))
4243

@@ -46,13 +47,14 @@ object Logger {
4647
def apply(clazz: Class[_]): Logger =
4748
new Logger(LoggerFactory.getLogger(clazz.getName))
4849

49-
/** Create a [[Logger]] for the runtime class wrapped by the implicit class
50-
* tag parameter.
51-
* Example:
52-
* {{{
53-
* val logger = Logger[MyClass]
54-
* }}}
55-
*/
50+
/**
51+
* Create a [[Logger]] for the runtime class wrapped by the implicit class
52+
* tag parameter.
53+
* Example:
54+
* {{{
55+
* val logger = Logger[MyClass]
56+
* }}}
57+
*/
5658
def apply[T](implicit ct: ClassTag[T]): Logger =
5759
new Logger(LoggerFactory.getLogger(ct.runtimeClass.getName.stripSuffix("$")))
5860
}

src/test/scala/com/typesafe/scalalogging/LoggerWithMarkerSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object DummyMarker extends Marker {
3434
def iterator(): java.util.Iterator[Marker] = new java.util.Iterator[Marker] {
3535
def hasNext(): Boolean = false
3636
def next(): Marker = throw new NoSuchElementException()
37-
def remove(): Unit = throw new NoSuchElementException()
37+
override def remove(): Unit = throw new NoSuchElementException()
3838
}
3939
def remove(child: Marker): Boolean = false
4040
}

0 commit comments

Comments
 (0)