Logger

The small library for logging which supports different priorities and strategies.

Лицензия

Лицензия

Группа

Группа

com.github.nikolaymenzhulin
Идентификатор

Идентификатор

logger
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

aar
Описание

Описание

Logger
The small library for logging which supports different priorities and strategies.
Ссылка на сайт

Ссылка на сайт

https://github.com/NikolayMenzhulin/Logger
Система контроля версий

Система контроля версий

https://github.com/NikolayMenzhulin/Logger

Скачать logger

Имя Файла Размер
logger-1.1.1.pom
logger-1.1.1-sources.jar 6 KB
logger-1.1.1-javadoc.jar 261 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.nikolaymenzhulin/logger/ -->
<dependency>
    <groupId>com.github.nikolaymenzhulin</groupId>
    <artifactId>logger</artifactId>
    <version>1.1.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.nikolaymenzhulin/logger/
implementation 'com.github.nikolaymenzhulin:logger:1.1.1'
// https://jarcasting.com/artifacts/com.github.nikolaymenzhulin/logger/
implementation ("com.github.nikolaymenzhulin:logger:1.1.1")
'com.github.nikolaymenzhulin:logger:aar:1.1.1'
<dependency org="com.github.nikolaymenzhulin" name="logger" rev="1.1.1">
  <artifact name="logger" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.nikolaymenzhulin', module='logger', version='1.1.1')
)
libraryDependencies += "com.github.nikolaymenzhulin" % "logger" % "1.1.1"
[com.github.nikolaymenzhulin/logger "1.1.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.10

runtime (1)

Идентификатор библиотеки Тип Версия
com.jakewharton.timber : timber jar 4.7.1

Модули Проекта

Данный проект не имеет модулей.

Logger

The small library for logging which supports different priorities and strategies.

build Maven Central License

Usage

Logger works with strategies that must be extends from LoggerStrategy interface. The library already provides the two realisations: TimberLoggerStrategy based on Timber and TestLoggerStrategy orientired on using in tests. In addition to these, you can implement your own. By default Logger uses TimberLoggerStrategy.

Use the following example of code to add strategies:

Logger.strategies.add(TimberLoggerStrategy())

// or

val strategies = listOf(TimberLoggerStrategy(), SomeOtherLoggerStrategy())
Logger.strategies.addAll(strategies)

Logger.strategies is actually a MutableList, so when you working with it you can use all the same methods the regular MutableList has.

The code for adding strategies is better placed in the application class of your app.
When you try using Logger without strategies it will be throw IllegalStateException.

After adding strategies use the following example of code to log something what you need:

// Logging uses TimberLoggerStrategy.

Logger.d("Hello world!") // Print "Hello World!" to DEBUG channel of Logcat.

Logger.e(Exception("Error message")) // Print the exception with the message "Error message" and the stacktrace to ERROR channel of Logcat.

Logger.i("Info with args: arg1=%s, arg2=%s", 1, 2) // Print "Info with args: arg1=1, arg2=2" to INFO channel of Logcat.

// etc.

Download

Step 1. Add the Maven Central repository to your build file:

allprojects {
    repositories {
        mavenCentral()
    }
}

Step 2. Add the dependency:

dependencies {
    implementation 'com.github.nikolaymenzhulin:logger:1.1.1'
}

License

Copyright © 2021 Nikolay Menzhulin.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Версии библиотеки

Версия
1.1.1
1.1.0
1.0.0