Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Latest commit

 

History

History
111 lines (75 loc) · 2.73 KB

README_EN.md

File metadata and controls

111 lines (75 loc) · 2.73 KB

Logger 4K

Jenkins GitHub license GitHub repo size JitPack

CHINESE | ENGLISH (Google Translate)

LOGGER4K Is a lightweight Kotlinlogging framework.

Getting Started

This project used Gradle to build coverage Junit test.

If you find a bug or comments, you can feedback under Issues.

Add this to the project

Before you start, you need to introduce the module into the project. The introduction of Apache Maven and Gradle is introduced below.

Maven & Gradle

1. Add it to the project:

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Gradle

allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}
2. Add dependencies

Maven

<dependency>
    <groupId>com.github.OpenEdgn.Logger4K</groupId>
    <artifactId>${modName}</artifactId>
    <version>${version}</version>
</dependency>

Gradle

dependencies {
    implementation 'com.github.OpenEdgn.Logger4K:${modName}:${version}'
}

$ {modName} represents the module name, and $ {version} represents the referenced version number.

version:JitPack

Usage

Basic usage of the Logger API:

val logger = getLogger () // Create a Logger object


 logger.debug ( " DEBUG Message. " ) 
  //   Output DEBUG type log (note that the log will not be output if DEBUG is not enabled)

 logger.info ( " INFO Message. " ) 
  //   Output INFO type log

 logger.warn (" WARN Message. ") 
  //   Output WARN type log

 logger.error("ERROR  Message.") 
  //   Output log of ERROR type

logger.debugOnly { 
    // This code block only runs in debug mode
    info("INFO")
    warn("WARN")
    debug("DEBUG")
    error("ERROR")
}

Please see PrintLogger.kt and LoggerMainTestAll.kt under TEST for more usage methods.

LICENSE

SEE LICENSE FILE