Giter Site home page Giter Site logo

Logging about moc-openstack-tools HOT 6 OPEN

cci-moc avatar cci-moc commented on July 21, 2024
Logging

from moc-openstack-tools.

Comments (6)

Lematsu avatar Lematsu commented on July 21, 2024

I'm thinking that the import logging module maybe ideal.
I do see this being a little bit time consuming due to the number of lines I will need to add.

Is there a more efficient way of logging that I am unaware of?

https://docs.python.org/2/howto/logging.html

from moc-openstack-tools.

kamfonik avatar kamfonik commented on July 21, 2024

That would work, but I think we might want to use oslo_log instead since this is an Openstack-related project.

from moc-openstack-tools.

Lematsu avatar Lematsu commented on July 21, 2024

Okay I'll look into oslo_log!

This is what I'm thinking of using for logging guidlines:
https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels/2031209#2031209

This is what I'm using for documentation:
https://docs.openstack.org/developer/oslo.log/usage.html

from moc-openstack-tools.

Lematsu avatar Lematsu commented on July 21, 2024

@kamfonik for reference, is there any code you have written in oslo.log in the past?

from moc-openstack-tools.

kamfonik avatar kamfonik commented on July 21, 2024

I haven't personally used it but Mix and Match does I believe:
https://github.com/openstack/mixmatch/

from moc-openstack-tools.

Lematsu avatar Lematsu commented on July 21, 2024

In the Mix and Match implementation, it utilizes the config and I'm working on doing something very similar.

My implementation is under branch tomatsu-logging:
https://github.com/CCI-MOC/moc-openstack-tools/compare/master...ltomatsu:tomatsu-logging

For logging, I am replacing print statements such as
print "Creating project: {}".format(project.name)
to
LOG.info("Creating project: {}".format(project.name))
and
print "WARNING: cannot add additional users to project{}from input:{}".format(entry[15], entry[17])
to
LOG.warning("WARNING: cannot add additional users to project {}form input:{}".format(entry[15], entry[17]))

To have this implemented in both addusers.py and set-quotas.py, I am adding the configuration steps of oslo_log in config.py.

from moc-openstack-tools.

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.