Giter Site home page Giter Site logo

logcapture's People

Contributors

acunap avatar dependabot-preview[bot] avatar dependabot[bot] avatar jordi-farre avatar jsalinaspolo avatar pityq avatar renovate-bot avatar voidshaper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logcapture's Issues

logcaputre migration guide from 1.2.2 to 1.3.x

Hi,

Is there a migration document to upgrade from 1.2.2 to 1.3.0 for instance? As I am seeing many unrelated tests failing once I update the version.

I am using:

kotlin("jvm") version "1.8.22"
io.kotest version 5.3.1
testImplementation("org.logcapture:logcapture-core:1.2.2")
testImplementation("org.logcapture:logcapture-kotest:1.2.2")

Thanks

Check for X times

Hello there,

First, a big thank you for the library, as it's proving very useful in our test cases.

As stated in the title, is it currently possible to check for the log messages X times, for example, when logging as part of a loop?

I'm going through the source code, but I have not found anything related to this.

Regards

Boolean APIs

@jsalinaspolo
Not sure if this has been raised before, but is there away to have the same APIs but return a boolean instead?

So instead of

logged(aLog().info().withMessage("a message"))

maybe something like

isLogged(aLog().info().withMessage("a message")) == true

The reason is that this will give more flexibility to work with other frameworks like kotest where I can have a precondition like

until(10.seconds) {
    isLogged(aLog().info().withMessage("a message"))
}

Do let me know if this is something we can have or not.

Thanks.

Use ListAppender instead of StubAppender

Hi guys, really cool to see that you all have been working on this. Without knowing of the existence of this project I have built something similar to the core module of this project... Maybe we can share some knowledge to learn from each-others solutions, see here: https://github.com/Hakky54/log-captor

But the main reason why I opened this issue is when I tried to understand the underlying core engine of the logcapture, I see that every log will be added to the Stubappender which is a custom implementation of an appender containing a list. The Stubappender has an additional method called events() which will return the iloggingevents. In this way the logs can be retrieved and asserted. There is already a ListAppender available within Logback, and I am using it in my library, which is capable of doing the same as the Stubappender and much more. So I am wondering why you guys preferred to use a custom Appender instead of the ListAppender. Looking forward to get your thoughts on this topic ๐Ÿ˜Š

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.


  • Check this box to trigger a request for Renovate to run again on this repository

Improve failures matching

Instead of throwing a RuntimeException with the log message not found, would be helpful to display the logs captured.

Add a way to see a captured log event

Let's say I have something like this in my production code:

var username = "fred";
MDC.put("user", username);
logger.warn("The user " + username + " has requested xyz");

I would like to be able to check that the message contains a string that matches a certain MDC key:

logCaptureListener.logged(aLog().withMdc("user", ???).withMessage(Mathers.containsString(<whatever was in Mdc>));

Perhaps this feature can be delivered in a similar way to Mockito's or Mockk's "capture" facitilities.

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.