Tinylog Singlelevel-CW Extension

A Tinylog console writer extension to restrict writers to single log levels (e.g. for level-specific colored logs).

Лицензия

Лицензия

Категории

Категории

tinylog Библиотеки уровня приложения Logging
Группа

Группа

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

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

tinylog-singlelevel-cw
Последняя версия

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

1.3.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Tinylog Singlelevel-CW Extension
A Tinylog console writer extension to restrict writers to single log levels (e.g. for level-specific colored logs).
Ссылка на сайт

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

https://github.com/tobiasrm/tinylog-singlelevel-cw
Система контроля версий

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

https://github.com/tobiasrm/tinylog-singlelevel-cw/tree/master

Скачать tinylog-singlelevel-cw

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.tinylog : tinylog jar 1.3.1

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

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

tinylog singlelevel cw

A tinylog console writer extension to restrict writers to single log levels.

Features

The singlelevel-cw extends tinylog with the singlelevel-console parameter to restrict log outputs to the corresponding level. This supports debugging by defining multiple writers and print exactly the log-levels you need (e.g. traces, warnings, and errors).

   tinylog.writer              = singlelevel-console 
   tinylog.writer.singlelevel  = <true|false>

Example

The following screenshot shows the example where messages are logged to all log-levels (see Main.java) but the singlelevel-cw prints only the log-levels trace, warn and error are printed (here in Eclipse using the 'err ' stream for warn/error). This is realized by defining multiple writers, one per log-level and all restricted to the corresponding level, but activating only the needed ones.

You can reproduce the example by running mvn clean install and then java -jar target/tinylog-singlelevel-cw-1.3.1-executable.jar.

Maven artifact

Add the following dependency to use the singlelevel-cw in your maven project:

<dependency>
	<groupId>com.github.tobiasrm</groupId>
	<artifactId>tinylog-singlelevel-cw</artifactId>
	<version>1.3.1</version>
</dependency>

Comments

  • Versioning. The versioning (see pom.xml) uses the original tinylog versions, e.g. tinylog-singlelevel-cw in version 1.3.1 uses tinylog v1.3.1. If needed, you may simply exclude it and use another tinylog version.
  • Patched Configuration class. The singlelevel-cw implements the tinylog writer interface and is based on the tinylog consolewriter implementation. However, as the original tinylog Configuration does not provide the access on writer specific levels, a patch is provided with this project. The modifications are highlighted in the screenshots one and two. Of course, feel invited to diff with the original version.

Other tinylog writer extensions

See also my other tinylog writer extension projects:

  • tinylog-coloredconsole for colored log-level and arbitrary source-code generated data through custom tags.
  • tinylog-tagging-filewriter extension to remove custom strings (e.g. the tinylog-coloredconsole custom tags) before writing to file (based on filewriter)
  • tinylog-tagging-rollingfilewriter extension to remove custom strings (e.g. the tinylog-coloredconsole custom tags) before writing to file (based on rollingfilewriter)

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

Версия
1.3.1