Log

Maven parent project for OSS publishment

Лицензия

Лицензия

Группа

Группа

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

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

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

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

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Log
Maven parent project for OSS publishment
Ссылка на сайт

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

http://log.sdklite.com
Организация-разработчик

Организация-разработчик

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

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

https://github.com/sdklite/log

Скачать log

Имя Файла Размер
log-0.0.1.pom
log-0.0.1.jar 11 KB
log-0.0.1-sources.jar 6 KB
log-0.0.1-javadoc.jar 56 KB
Обзор

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

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

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
com.google.android : android jar 4.1.1.4

test (6)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.robolectric : robolectric jar 3.0
org.robolectric : android-all jar 5.0.0_r2-robolectric-1
org.hamcrest : hamcrest-library jar 1.3
org.eclipse.jetty : jetty-server jar 9.3.0.M0
org.eclipse.jetty : jetty-servlet jar 9.3.0.M0

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

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

Overview

The log framework is used for message logging, and designed for Android platform in special, there were many famous logging library, such as log4j, slf4j, logback, etc. All of those were designed for Java, but Android is not Java, the cost of time during application startup is a very import evaluation indicator for an application. Reducing the I/O consuming time during application startup is helpful for improving the performance, so, that's why it's been created.

This log framework is an interface for logging, it doesn't contains implementations in default, it must be combined with only one of logger implementations in following list or other implementation.

Getting Started

Logger logger = LoggerFactory.getLogger("Anonymous");

logger.info("Application startup at {0,time} on {0,date}", new Date());

try {
    ...
} catch (Throwable t) {
    logger.error("Oops! error occurred: {0}", t);
}

Customization

The interface and implementaion of logger are bound by the LoggerBinder stub class, so, any logger implementation must implements the stub methods in LoggerBinder class, for example:

LoggerBinder

package com.sdklite.log.bind;

import com.sdklite.log.Level;
import com.sdklite.log.Logger;

public class LoggerBinder {

    public static final LoggerBinder getInstance() {
        return Internal.BINDER;
    }

    private LoggerBinder() {
    }

    public Logger getLogger(final String name) {
        return new ConsoleLogger(name);
    }

    public Level getDefaultLevel() {
        return Level.INFO;
    }

    private staitc final class Internal {
        private static final LoggerBinder BINDER = new LoggerBinder();
    }
}

ConsoleLogger

public class ConsoleLogger extends AbstractLogger {

    private final String name;

    public ConsoleLogger(final String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public Logger println(final Level level, final String msg, final Object... args) {
        if (level.intValue() < Level.ERROR.intValue()) {
            System.out.println(format(msg, args));
        } else if (level.intValue() < Level.OFF.intValue()) {
            System.err.println(format(msg, args));
        }

        return this;
    }

}

Download

GitHub

Download latest source code from here.

Maven

<dependency>
  <groupId>com.sdklite</groupId>
  <groupId>log</groupId>
  <version>0.0.1</version>
</dependency>

Gradle

compile 'com.sdklite:log:0.0.1'

Documentation

Please see http://log.sdklite.com.

com.sdklite

SDKLite

SDKLite

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

Версия
0.0.1