All Projects → cloudoptlab → Cloudopt Logger

cloudoptlab / Cloudopt Logger

Licence: apache-2.0
Cloudopt-logger is an extensible and configurable logging framework extension based on Kotlin, supporting Java, Kotlin and Android.

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Cloudopt Logger

Bus
Bus 是一个基础框架、服务套件,它基于Java8编写,参考、借鉴了大量已有框架、组件的设计,可以作为后端服务的开发基础中间件。代码简洁,架构清晰,非常适合学习使用。
Stars: ✭ 253 (+622.86%)
Mutual labels:  spring, logger
Hrrs
Record, transform, and replay HTTP requests in Java EE and Spring applications.
Stars: ✭ 54 (+54.29%)
Mutual labels:  spring, logger
Spring Cloud Examples
Examples of microservice instrastructures
Stars: ✭ 11 (-68.57%)
Mutual labels:  spring
Javabrainmap
Java 体系涉及到的各方面知识点脑图总结,万物皆脑图。The knowledge of all aspects of the Java system is summarized in the brain map.
Stars: ✭ 33 (-5.71%)
Mutual labels:  spring
Cartus
A structured logging abstraction with multiple backends.
Stars: ✭ 21 (-40%)
Mutual labels:  logger
Tiny Spring
本项目是一个精简版的spring,通过自己实现一遍spring来理解spring框架的精华。
Stars: ✭ 13 (-62.86%)
Mutual labels:  spring
Spring Depend
Tool for getting a spring bean dependency graph
Stars: ✭ 28 (-20%)
Mutual labels:  spring
Jsf2.2 Spring4 Hibernate4 Mysql
Full configured JSF2.2.10, Primefaces5, Spring4, Hibernate4/MySQL working project
Stars: ✭ 10 (-71.43%)
Mutual labels:  spring
Spring framework
Examples on Spring(Core, AOP, DAO, Transaction Management)
Stars: ✭ 34 (-2.86%)
Mutual labels:  spring
Ruoyi
(RuoYi)官方仓库 基于SpringBoot的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖。直接运行即可用
Stars: ✭ 905 (+2485.71%)
Mutual labels:  spring
Jbone
jbone基于Spring Cloud框架开发,旨在为中小企业提供稳定的微服务解决方案,为开发人员提供基础开发骨架,jbone包含微服务中所有常用组件,例如注册中心、服务管理、服务监控、JVM监控、内存分析、调用链跟踪、API网关等等。业务功能包括系统权限的统一管理、单点登录、CMS、电商平台、工作流平台、支付平台等等。
Stars: ✭ 961 (+2645.71%)
Mutual labels:  spring
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+2422.86%)
Mutual labels:  logger
Ssm redis template
An template based on Maven, using Spring + Spring MVC + mybatis + spring-data-redis frames. It can be used to construct a new Java Web Appliaction quickly
Stars: ✭ 13 (-62.86%)
Mutual labels:  spring
Escriba
📜 Logging on steroids
Stars: ✭ 30 (-14.29%)
Mutual labels:  logger
Spring Reactive Sample
Spring 5 Reactive playground
Stars: ✭ 867 (+2377.14%)
Mutual labels:  spring
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (-5.71%)
Mutual labels:  logger
Goslings
Goslings - Git Repository Visualizer
Stars: ✭ 11 (-68.57%)
Mutual labels:  spring
Spring Mvc Thymeleaf Crud
Spring MVC CRUD Application with Thymeleaf, HTML5, CSS3 and Bootstrap
Stars: ✭ 14 (-60%)
Mutual labels:  spring
Angular7 Springboot Crud Tutorial
Develop a single page application(SPA) using Angular 7 as a front-end and Spring boot restful API as a backend.
Stars: ✭ 21 (-40%)
Mutual labels:  spring
Springws
基于SpringMVC实现的WebSocket工程实例
Stars: ✭ 35 (+0%)
Mutual labels:  spring

Cloudopt Next

Awesome Kotlin Badge Apache Licenses Badge Twitter Badge

Cloudopt-logger is an extensible and configurable logging framework extension based on Kotlin, supporting Java, Kotlin and Android.

screenshot screenshot

Features:

  • supports color log output.

  • support multiple logging frameworks, such as Slf4j, Log4j, and so on.

  • easy to extend.

  • more user-friendly and convenient to debug output.

中文文档

Installation

Introduce in Maven:

  <dependency>
    <groupId>net.cloudopt.logger</groupId>
    <artifactId>cloudopt-logger</artifactId>
    <version>1.0.1</version>
  </dependency>

If you are using Slf4j, you need to introduce the appropriate libraries, such as:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.25</version>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.2.3</version>
</dependency>

How to use

Simple to use, just introduce the Logger class. Here are a few examples:

package net.cloudopt.logger

import org.junit.Test

class TestCase {

    private val logger = Logger.getLogger(TestCase::class.java)

    @Test
    fun example1() {
        logger.debug("Start init....")
        logger.info("Operation successful!")
        logger.warn("The value must be not nul.")
        logger.error("Unable to acquire lock!")
    }

    @Test
    fun example2() {
        logger.info("Please Wait.... ${Colorer.blue("100")}")
        logger.info("Please Wait.... ${Colorer.yellow("200")}")
        logger.info("Please Wait.... ${Colorer.red("300")}")
    }

    @Test
    fun example3() {
        val configuration = LoggerConfiguration()
        configuration.run {
            this.color = false
        }
        Logger.configuration = configuration
        example1()
    }

    @Test
    fun example4() {
        val configuration = LoggerConfiguration()
        configuration.run {
            this.debugPrefix = "DEBUG"
            this.infoPrefix = "INFO"
            this.warnPrefix = "WARN"
            this.errorPrefix = "ERROR"
        }
        Logger.configuration = configuration
        example1()
    }
}
public class TestJavaCase {
    private Logger logger = Logger.Companion.getLogger(TestCase.class);

    @Test
    public void example1() {
        logger.debug("Start init....");
        logger.info("Operation successful!");
        logger.warn("The value must be not nul.");
        logger.error("Unable to acquire lock!");
    }

    @Test
    public void example2() {
        logger.info("Please Wait.... " + Colorer.INSTANCE.blue("100"));
        logger.info("Please Wait.... " + Colorer.INSTANCE.yellow("200"));
        logger.info("Please Wait.... " + Colorer.INSTANCE.red("300"));
    }

    @Test
    public void example3() {
        LoggerConfiguration configuration = new LoggerConfiguration();
        configuration.setColor(false);
        Logger.Companion.setConfiguration(configuration);
        example1();
    }

    @Test
    public void example4() {
        LoggerConfiguration configuration = new LoggerConfiguration();
        configuration.setDebugPrefix("DEBUG");
        configuration.setInfoPrefix("INFO");
        configuration.setWarnPrefix("WARN");
        configuration.setErrorPrefix("ERROR");
        Logger.Companion.setConfiguration(configuration);
        example1();
    }
}

If you want to change the color of any output character, just wrap it in a Colorer. Eight colors are already built in.

How to extend

Support for Slf4j is now built in, and with Slf4j you can support logback, log4j, log4j2, etc. If you need to support it directly or support other logging frameworks, you can do so by referring to Slf4jLoggerProvider.

Follow us

You can focus on our twitter or is to focus on the micro letter, public the latest news we will via twitter or released to the public.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].