Giter VIP home page Giter VIP logo

rainbowgum's Issues

Maven/Gradle Rainbow Gum bundle should have pattern and friends as scope compile

PS: one small suggestion though, you may have noticed that I did include not just core, but also pattern explicitly, as having it pulled transitively by gradle does not make it accessible as implementation even if io.jstach.rainbowgum:rainbowgum is included as such. I think to have a better developer ergonomic, when including io.jstach.rainbowgum:rainbowgum, the transitive dependencies should be pulled in with the same scope so that having implementation("io.jstach.rainbowgum:rainbowgum:0.2.0") is enough. When just wanting to use the defaults, having runtimeOnly("io.jstach.rainbowgum:rainbowgum:0.2.0") should be sufficient.

Originally posted by @cmdjulian in #55 (comment)

`Throwable` methods don't log anything on `slf4j` binding

Not quite sure why, but only the first log statement gets actually logged, the other two invocations don't print anything. Am I doing something wrong here?

private val logger = KotlinLogging.logger {}

fun main() {
    logger.info { "Hello, World!" }
    logger.error(IllegalArgumentException()) { "Hello, World!" }
    logger.error("Hello, World!", IllegalArgumentException())
}

It seems like this is for all logger methods which do include a Throwable in their signature. The logger faced I'm using on top of Rainbowgum is kotlin-logging which relies on slf4j. For other loggers like logback everything works as it should.

I created a small reproducer: logger.zip

Health checks, status, MetaLog

Rainbow Gum needs a way to collect errors for microservices that do health checks.

Logback does this I think with something called Status or Status Manager.

Not sure Log4j2 does but probably similar.

Currently catastrophic failures are just System.err but if we provide resilient outputs we will want to keep track of this.

How to configure ansi color output

I have the following logger:

@AutoService(RainbowGumProvider::class)
class RainbowGumProviderImpl : RainbowGumProvider {
    override fun provide(config: LogConfig): Optional<RainbowGum> = RainbowGum.builder(config)
        .route { builder ->
            builder.level(Level.INFO)
            builder.appender("console") { appender ->
                val encoder = PatternEncoderBuilder("console")
                    .pattern("%cyan(%d{YYYY-MM-dd HH:mm:ss.SSS}) [%yellow(%thread)] %highlight(%-5level) %logger{36}: %msg%n")
                    .fromProperties(config.properties())
                    .build()

                appender.encoder(encoder)
                appender.output(LogOutput.ofStandardOut())
            }
        }
        .optional()
}

This is my gradle config:

dependencies {
    ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0")
    implementation("com.google.auto.service:auto-service-annotations:1.1.1")

    // logging
    implementation("io.jstach.rainbowgum:rainbowgum:0.2.0")
    implementation("io.jstach.rainbowgum:rainbowgum-core:0.2.0")
    implementation("io.jstach.rainbowgum:rainbowgum-pattern:0.2.0")
    implementation("io.jstach.rainbowgum:rainbowgum-jansi:0.2.0")
}

As you can see in my pattern I have configured colored output. Regardless of that the output is just white. Is there something I do wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.