Giter Club home page Giter Club logo

Comments (4)

carterbox avatar carterbox commented on May 25, 2024

@dgursoy, This is what we talked about today. Any more thoughts?

from tike.

dgursoy avatar dgursoy commented on May 25, 2024

Looks good. One concern is we need a level of control for the print statements though. Otherwise, it won't be structured and we can't use them easily afterwards. For example, if I print a "Hello World" somewhere, I may not want to have it in the txt file.

from tike.

carterbox avatar carterbox commented on May 25, 2024

I guess you could use the __debug__ switch to save files instead. For example:

if __debug__:
    np.save('./debug_data/', some_data)

But also, if the user doesn't use the -O switch, it's better to dump a bunch of text to stdout instead of making files on their disk?

I think __debug__ can only be set before runtime, so we can't protect the user by setting it for them in the code.

from tike.

carterbox avatar carterbox commented on May 25, 2024

Today I learned that the logger in a python library should be set to use the NullHandler. This is how it is set up for TomoPy and it allows the library to inherit whatever logging environment the end user has set up.

https://docs.python.org/3/howto/logging.html#library-config

from tike.

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.