This repository has been archived by the owner on Jul 29, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from writeonly/logging
Logging
- Loading branch information
Showing
7 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package pl.writeonly.re.shared | ||
|
||
object Core { | ||
def apply(arg: String): Unit = { | ||
println(s"Hello Scala $arg!") | ||
trait Core { | ||
def apply(arg: String): Unit | ||
} | ||
|
||
object Core extends Core { | ||
override def apply(arg: String): Unit = { | ||
StrictLoggingCore(arg) | ||
LazyLoggingCore(arg) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
re/shared/src/main/scala/pl/writeonly/re/shared/LazyLoggingCore.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package pl.writeonly.re.shared | ||
|
||
import slogging.LazyLogging | ||
|
||
object LazyLoggingCore extends Core with LazyLogging { | ||
def apply(arg: String): Unit = { | ||
logger.info(s"Hello Scala $arg!") | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
re/shared/src/main/scala/pl/writeonly/re/shared/StrictLoggingCore.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package pl.writeonly.re.shared | ||
|
||
import slogging.StrictLogging | ||
|
||
object StrictLoggingCore extends Core with StrictLogging { | ||
def apply(arg: String): Unit = { | ||
logger.info(s"Hello Scala $arg!") | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
re/shared/src/test/scala/pl/writeonly/re/shared/CoreTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package pl.writeonly.re.shared | ||
|
||
import utest._ | ||
|
||
object CoreTest extends TestSuite { | ||
override val tests: Tests = Tests { | ||
'core - { | ||
Core("Awesome") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters