Git Product home page Git Product logo

Comments (5)

bpoldrack avatar bpoldrack commented on June 5, 2024

Can't we just make the logger directing ERROR to stderr instead of stdout?

2015-02-25 19:24 GMT+01:00 Yaroslav Halchenko [email protected]:

now if we run

$> nosetests -s -v datalad/tests/
datalad.tests.test_annexrepo.test_AnnexRepo_instance_brand_new ... ok
datalad.tests.test_annexrepo.test_AnnexRepo_instance_from_clone ... 2015-02-25 13:19:13,261 [ERROR ] 'git clone -v /home/yoh/proj/datalad/datalad/datalad/tests/testrepos/basic/r1 /home/yoh/.tmp/tmptoMerM' returned with exit code 128
| stderr: 'fatal: destination path '/home/yoh/.tmp/tmptoMerM' already exists and is not an empty directory.
| ' (gitrepo.py:59)
ok
...

we get them spit out to the screen, which is not proper since they are
intended to error out at that point (right @bpoldrack
https://github.com/bpoldrack ?). so we need to swallow them.
In fail2ban we have a derived TestCase class for that purpose:
https://github.com/fail2ban/fail2ban/blob/HEAD/fail2ban/tests/utils.py#L200
which also allows to analyze those logs for testing (which we would need
to). But here we better come up with a decorator which captures and exposes
within the test the logs. Any takers? ;)


Reply to this email directly or view it on GitHub
#45.

from datalad.

bpoldrack avatar bpoldrack commented on June 5, 2024

And what about this brand new idea of having a logger write it's output to a logfile, what you can browse/analyze afterwards?

from datalad.

yarikoptic avatar yarikoptic commented on June 5, 2024
  1. Regarding "directing ERROR to stderr instead of stdout" -- good idea in case of stdout (not file) output but not sure if I know/used straight solution for that with the python logger -- we might would need to provide a shim around the two. If interested -- figure it out BUT this is far from being a priority ATM. Just file a new issue so we don't forget
  2. logging to a file will happen and very simple todo, but also not a priority ATM. We will do it whenever we start working on a datalad config facility probably. But just to make you happy I will do it in a PR shortly

swallowing/suppressing logs is a bit more important atm since they pollute output of running tests

from datalad.

yarikoptic avatar yarikoptic commented on June 5, 2024

for 2. just accept #46 pull request

from datalad.

yarikoptic avatar yarikoptic commented on June 5, 2024

was implemented with swallow_logs context manager in 43e2d72

from datalad.

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.