Skip to content

Commit

Permalink
Merge pull request #8 from ToxicBakery/feature/exceptions-without-mes…
Browse files Browse the repository at this point in the history
…sage

Allow exceptions without a message.
  • Loading branch information
ToxicBakery committed Jan 26, 2019
2 parents 10491e2 + c47b7c8 commit dae900e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ subprojects {
String buildNumber = System.getenv('CIRCLE_BUILD_NUM') ?: "0"

group 'com.ToxicBakery.logging'
version "1.28.$buildNumber" + (isTag ? "" : "-SNAPSHOT")
version "1.29.$buildNumber" + (isTag ? "" : "-SNAPSHOT")

repositories {
google()
Expand Down
12 changes: 6 additions & 6 deletions common/src/commonMain/kotlin/com/toxicbakery/logging/Arbor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,37 @@ class Arbor {
fun d(msg: String) = perennial.d(msg)

@JvmStatic
fun d(throwable: Throwable, msg: String) = perennial.d(throwable, msg)
fun d(throwable: Throwable, msg: String = "") = perennial.d(throwable, msg)

@JvmStatic
fun v(msg: String) = perennial.v(msg)

@JvmStatic
fun v(throwable: Throwable, msg: String) = perennial.v(throwable, msg)
fun v(throwable: Throwable, msg: String = "") = perennial.v(throwable, msg)

@JvmStatic
fun i(msg: String) = perennial.i(msg)

@JvmStatic
fun i(throwable: Throwable, msg: String) = perennial.i(throwable, msg)
fun i(throwable: Throwable, msg: String = "") = perennial.i(throwable, msg)

@JvmStatic
fun w(msg: String) = perennial.w(msg)

@JvmStatic
fun w(throwable: Throwable, msg: String) = perennial.w(throwable, msg)
fun w(throwable: Throwable, msg: String = "") = perennial.w(throwable, msg)

@JvmStatic
fun e(msg: String) = perennial.e(msg)

@JvmStatic
fun e(throwable: Throwable, msg: String) = perennial.e(throwable, msg)
fun e(throwable: Throwable, msg: String = "") = perennial.e(throwable, msg)

@JvmStatic
fun wtf(msg: String) = perennial.wtf(msg)

@JvmStatic
fun wtf(throwable: Throwable, msg: String) = perennial.wtf(throwable, msg)
fun wtf(throwable: Throwable, msg: String = "") = perennial.wtf(throwable, msg)

}

Expand Down
12 changes: 6 additions & 6 deletions common/src/commonMain/kotlin/com/toxicbakery/logging/Branch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ class Branch internal constructor(seedlings: Set<ISeedling> = setOf()) {
internal fun reset() = seedlings.clear()

fun d(msg: String) = seedlings.forEach { seedling -> seedling.log(Arbor.DEBUG, seedling.tag, msg) }
fun d(throwable: Throwable, msg: String) =
fun d(throwable: Throwable, msg: String = "") =
seedlings.forEach { seedling -> seedling.log(Arbor.DEBUG, seedling.tag, msg, throwable) }

fun v(msg: String) = seedlings.forEach { seedling -> seedling.log(Arbor.VERBOSE, seedling.tag, msg) }
fun v(throwable: Throwable, msg: String) =
fun v(throwable: Throwable, msg: String = "") =
seedlings.forEach { seedling -> seedling.log(Arbor.VERBOSE, seedling.tag, msg, throwable) }

fun i(msg: String) = seedlings.forEach { seedling -> seedling.log(Arbor.INFO, seedling.tag, msg) }
fun i(throwable: Throwable, msg: String) =
fun i(throwable: Throwable, msg: String = "") =
seedlings.forEach { seedling -> seedling.log(Arbor.INFO, seedling.tag, msg, throwable) }

fun w(msg: String) = seedlings.forEach { seedling -> seedling.log(Arbor.WARNING, seedling.tag, msg) }
fun w(throwable: Throwable, msg: String) =
fun w(throwable: Throwable, msg: String = "") =
seedlings.forEach { seedling -> seedling.log(Arbor.WARNING, seedling.tag, msg, throwable) }

fun e(msg: String) = seedlings.forEach { seedling -> seedling.log(Arbor.ERROR, seedling.tag, msg) }
fun e(throwable: Throwable, msg: String) =
fun e(throwable: Throwable, msg: String = "") =
seedlings.forEach { seedling -> seedling.log(Arbor.ERROR, seedling.tag, msg, throwable) }

fun wtf(msg: String) = seedlings.forEach { seedling -> seedling.log(Arbor.WTF, seedling.tag, msg) }
fun wtf(throwable: Throwable, msg: String) =
fun wtf(throwable: Throwable, msg: String = "") =
seedlings.forEach { seedling -> seedling.log(Arbor.WTF, seedling.tag, msg, throwable) }

}

0 comments on commit dae900e

Please sign in to comment.