-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typo in package naming.
- Loading branch information
Bojan
committed
Apr 25, 2021
1 parent
2c3a2ea
commit 7280f7d
Showing
29 changed files
with
159 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
-keep public class com.infinum.dbinspector.DbInspector { | ||
public protected *; | ||
} | ||
-keep public class com.infinum.dbinspector.data.models.memory.logger.Level { | ||
public protected *; | ||
} | ||
-keep public class com.infinum.dbinspector.data.sources.memory.logger.Logger { | ||
public protected *; | ||
} | ||
-keep public class com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger { | ||
public protected *; | ||
} | ||
-keep public class com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger { | ||
public protected *; | ||
} | ||
|
6 changes: 5 additions & 1 deletion
6
dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt
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,11 @@ | ||
package com.infinum.dbinspector | ||
|
||
import com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger | ||
import com.infinum.dbinspector.data.sources.memory.logger.Logger | ||
|
||
@Suppress("UnusedPrivateMember") | ||
public object DbInspector { | ||
|
||
@JvmStatic | ||
public fun show(): Unit = Unit | ||
public fun show(logger: Logger = EmptyLogger()): Unit = Unit | ||
} |
8 changes: 8 additions & 0 deletions
8
dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt
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,8 @@ | ||
package com.infinum.dbinspector.data.models.memory.logger | ||
|
||
public enum class Level { | ||
DEBUG, | ||
INFO, | ||
ERROR, | ||
NONE | ||
} |
2 changes: 1 addition & 1 deletion
2
...ata/source/memory/logger/AndroidLogger.kt → ...ta/sources/memory/logger/AndroidLogger.kt
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
2 changes: 1 addition & 1 deletion
2
.../data/source/memory/logger/EmptyLogger.kt → ...data/sources/memory/logger/EmptyLogger.kt
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
4 changes: 2 additions & 2 deletions
4
dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt
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
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
8 changes: 4 additions & 4 deletions
8
.../data/source/local/cursor/SchemaSource.kt → ...data/sources/local/cursor/SchemaSource.kt
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
2 changes: 1 addition & 1 deletion
2
...e/local/proto/history/HistoryDataStore.kt → ...s/local/proto/history/HistoryDataStore.kt
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
2 changes: 1 addition & 1 deletion
2
.../local/proto/history/HistorySerializer.kt → .../local/proto/history/HistorySerializer.kt
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
2 changes: 1 addition & 1 deletion
2
...local/proto/settings/SettingsDataStore.kt → ...local/proto/settings/SettingsDataStore.kt
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
2 changes: 1 addition & 1 deletion
2
...ocal/proto/settings/SettingsSerializer.kt → ...ocal/proto/settings/SettingsSerializer.kt
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
2 changes: 1 addition & 1 deletion
2
...ory/connection/AndroidConnectionSource.kt → ...ory/connection/AndroidConnectionSource.kt
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
24 changes: 24 additions & 0 deletions
24
...ector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt
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,24 @@ | ||
package com.infinum.dbinspector.data.sources.memory.logger | ||
|
||
import android.util.Log | ||
import com.infinum.dbinspector.data.models.memory.logger.Level | ||
|
||
public class AndroidLogger( | ||
level: Level = Level.INFO | ||
) : Logger(level) { | ||
|
||
override fun log(level: Level, message: String) { | ||
if (this.level <= level) { | ||
logOnLevel(message, level) | ||
} | ||
} | ||
|
||
private fun logOnLevel(message: String, level: Level) { | ||
when (level) { | ||
Level.DEBUG -> Log.d(tag(), message) | ||
Level.INFO -> Log.i(tag(), message) | ||
Level.ERROR -> Log.e(tag(), message) | ||
else -> Log.e(tag(), message) | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...spector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt
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,8 @@ | ||
package com.infinum.dbinspector.data.sources.memory.logger | ||
|
||
import com.infinum.dbinspector.data.models.memory.logger.Level | ||
|
||
internal class EmptyLogger : Logger(Level.NONE) { | ||
|
||
override fun log(level: Level, message: String) = Unit | ||
} |
39 changes: 39 additions & 0 deletions
39
dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt
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,39 @@ | ||
package com.infinum.dbinspector.data.sources.memory.logger | ||
|
||
import com.infinum.dbinspector.data.models.memory.logger.Level | ||
|
||
public abstract class Logger( | ||
public var level: Level = Level.INFO | ||
) { | ||
|
||
public companion object { | ||
internal const val DEFAULT_LOG_TAG = "[DbInspector]" | ||
} | ||
|
||
@Suppress("MemberVisibilityCanBePrivate") | ||
public var tag: String? = null | ||
|
||
public abstract fun log(level: Level, message: String) | ||
|
||
public fun debug(message: String) { | ||
doLog(Level.DEBUG, message) | ||
} | ||
|
||
public fun info(message: String) { | ||
doLog(Level.INFO, message) | ||
} | ||
|
||
public fun error(message: String) { | ||
doLog(Level.ERROR, message) | ||
} | ||
|
||
protected fun tag(): String = tag ?: DEFAULT_LOG_TAG | ||
|
||
private fun canLog(level: Level): Boolean = this.level <= level | ||
|
||
private fun doLog(level: Level, message: String) { | ||
if (canLog(level)) { | ||
log(level, message) | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...urce/memory/pagination/CursorPaginator.kt → ...rces/memory/pagination/CursorPaginator.kt
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
2 changes: 1 addition & 1 deletion
2
...ata/source/memory/pagination/Paginator.kt → ...ta/sources/memory/pagination/Paginator.kt
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
2 changes: 1 addition & 1 deletion
2
...data/source/raw/AndroidDatabasesSource.kt → ...ata/sources/raw/AndroidDatabasesSource.kt
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
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