Skip to content

Commit

Permalink
Merge pull request #81 from PhilipDukhov/dev/2.0.0
Browse files Browse the repository at this point in the history
DebugAntilog made common class with expect/actual
  • Loading branch information
AAkira authored Aug 22, 2021
2 parents 43b615f + 0010460 commit 32b5f69
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.io.PrintWriter
import java.io.StringWriter
import java.util.regex.Pattern

class DebugAntilog(private val defaultTag: String = "app") : Antilog() {
actual class DebugAntilog actual constructor(private val defaultTag: String) : Antilog() {

companion object {
private const val MAX_LOG_LENGTH = 4000
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.github.aakira.napier

expect class DebugAntilog(defaultTag: String = "app") : Antilog
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import platform.Foundation.NSThread

private const val CALL_STACK_INDEX = 8

class DebugAntilog(
actual class DebugAntilog(
private val defaultTag: String = "app",
private val coroutinesSuffix: Boolean = true,
) : Antilog() {
actual constructor(defaultTag: String) : this(defaultTag, coroutinesSuffix = true)

var crashAssert = false

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.github.aakira.napier

import io.github.aakira.napier.Antilog
import io.github.aakira.napier.Napier

class DebugAntilog(private val defaultTag: String = "app") : Antilog() {
actual class DebugAntilog actual constructor(private val defaultTag: String) : Antilog() {

override fun performLog(priority: LogLevel, tag: String?, throwable: Throwable?, message: String?) {
val logTag = tag ?: defaultTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import java.util.logging.Logger
import java.util.logging.SimpleFormatter
import java.util.regex.Pattern

class DebugAntilog(
actual class DebugAntilog(
private val defaultTag: String = "app",
private val handler: List<Handler> = listOf()
) : Antilog() {
actual constructor(defaultTag: String) : this(defaultTag, handler = listOf())

companion object {
private const val CALL_STACK_INDEX = 8
Expand Down

0 comments on commit 32b5f69

Please sign in to comment.