-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
Key
s with arguments, improved API for SimpleLogger
s, and …
…new khronicle-test module (#33)
- Loading branch information
1 parent
aa004ef
commit 5e15c88
Showing
22 changed files
with
358 additions
and
204 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 |
---|---|---|
|
@@ -27,6 +27,7 @@ kotlin { | |
|
||
commonTest.dependencies { | ||
implementation(kotlin("test")) | ||
implementation(projects.khronicleTest) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.juul.khronicle | ||
|
||
/** | ||
* Simplified [Logger] which passes all logs through a single [log] function that accepts an | ||
* additional [LogLevel] argument. This is particularly useful when a logging backend does not have | ||
* separate function calls for each log level. | ||
*/ | ||
public abstract class SimpleLogger : Logger { | ||
|
||
final override fun verbose(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) { | ||
log(LogLevel.Verbose, tag, message, metadata, throwable) | ||
} | ||
|
||
final override fun debug(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) { | ||
log(LogLevel.Debug, tag, message, metadata, throwable) | ||
} | ||
|
||
final override fun info(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) { | ||
log(LogLevel.Info, tag, message, metadata, throwable) | ||
} | ||
|
||
final override fun warn(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) { | ||
log(LogLevel.Warn, tag, message, metadata, throwable) | ||
} | ||
|
||
final override fun error(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) { | ||
log(LogLevel.Error, tag, message, metadata, throwable) | ||
} | ||
|
||
final override fun assert(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) { | ||
log(LogLevel.Assert, tag, message, metadata, throwable) | ||
} | ||
|
||
public abstract fun log(level: LogLevel, tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) | ||
} |
Oops, something went wrong.