Code Monkey home page Code Monkey logo

Comments (3)

aminalaee avatar aminalaee commented on May 22, 2024

I might be missing something but even the standard library logging doesn't assert this:

def test_case():
    logger = logging.Logger("test")
    logger.parent = logging.Logger("parent", logging.WARNING)

    stream = io.StringIO()
    handler = logging.StreamHandler(stream)
    logger.addHandler(handler)

    logger.log(logging.DEBUG, "Hello World")
    assert stream.getvalue() == ""

    logger.parent.setLevel(logging.DEBUG)

    logger.log(logging.DEBUG, "Hello World")
    assert stream.getvalue() == "Hello World\n"  # Failing

And then the test with picologging has the same behaviour and does not pass either.

from picologging.

pamelafox avatar pamelafox commented on May 22, 2024

I've actually added the suggested situation in my latest PR, https://github.com/microsoft/picologging/pull/108/files#diff-7c31002b037ae4bc2888350bb25d9b9621c6aff7e98d6e6871a8a649d088e27bR516
I changed the test to use getLogger and dots in the name for parent setting, as the logging library does not encourage directly using the constructor or directly setting the parent. With those changes, the test passes in stdlib and my branch.

from picologging.

pamelafox avatar pamelafox commented on May 22, 2024

Change merged!

from picologging.

Related Issues (20)

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.