-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBS-11239 Add AndroidLogcatLoggingHandler.kt (#1296)
- Loading branch information
1 parent
5114cf1
commit 7cabdf2
Showing
32 changed files
with
107 additions
and
127 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
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,8 @@ | ||
plugins { | ||
id("convention.kotlin-android-library") | ||
id("convention.publish-android-library") | ||
} | ||
|
||
dependencies { | ||
api(projects.subprojects.logger.logger) | ||
} |
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 @@ | ||
<manifest package="com.avito.android.logger"/> |
19 changes: 19 additions & 0 deletions
19
...er/android-logger/src/main/kotlin/com/avito/logger/handler/AndroidLogcatLoggingHandler.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,19 @@ | ||
package com.avito.logger.handler | ||
|
||
import android.util.Log | ||
import com.avito.logger.LogLevel | ||
|
||
internal class AndroidLogcatLoggingHandler( | ||
private val tag: String, | ||
acceptedLogLevel: LogLevel | ||
) : LogLevelLoggingHandler(acceptedLogLevel) { | ||
|
||
override fun handleIfAcceptLogLevel(level: LogLevel, message: String, error: Throwable?) { | ||
when (level) { | ||
LogLevel.DEBUG -> Log.d(tag, message, error) | ||
LogLevel.INFO -> Log.i(tag, message, error) | ||
LogLevel.WARNING -> Log.w(tag, message, error) | ||
LogLevel.CRITICAL -> Log.e(tag, message, error) | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...id-logger/src/main/kotlin/com/avito/logger/handler/AndroidLogcatLoggingHandlerProvider.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,14 @@ | ||
package com.avito.logger.handler | ||
|
||
import com.avito.logger.LogLevel | ||
import com.avito.logger.metadata.LoggerMetadata | ||
|
||
public class AndroidLogcatLoggingHandlerProvider(private val acceptedLogLevel: LogLevel) : LoggingHandlerProvider { | ||
|
||
override fun provide(metadata: LoggerMetadata): LoggingHandler { | ||
return AndroidLogcatLoggingHandler( | ||
tag = metadata.asMessagePrefix, | ||
acceptedLogLevel = acceptedLogLevel | ||
) | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
...ojects/logger/gradle-logger/src/main/kotlin/com/avito/logger/FileHandledLoggerMetadata.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,5 +1,6 @@ | ||
package com.avito.logger | ||
|
||
import com.avito.logger.metadata.LoggerMetadata | ||
import java.nio.file.Path | ||
|
||
/** | ||
|
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
3 changes: 3 additions & 0 deletions
3
subprojects/logger/gradle-logger/src/main/kotlin/com/avito/logger/GradleMetadataProvider.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
25 changes: 0 additions & 25 deletions
25
subprojects/logger/logger/src/main/kotlin/com/avito/logger/LoggerMetadataProvider.kt
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
subprojects/logger/logger/src/main/kotlin/com/avito/logger/LoggingFormatter.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...jects/logger/logger/src/main/kotlin/com/avito/logger/formatter/AppendMetadataFormatter.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
subprojects/logger/logger/src/main/kotlin/com/avito/logger/handler/LoggingHandlerProvider.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
Oops, something went wrong.