GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use of logging utilities · Issue #237 · cclib/cclib

Use of logging utilities #237

New issue
Copy link
New issue
Copy link
Open
Open
Use of logging utilities#237
Copy link
Labels
good-first-issueparsersquestion
Milestone
v2.0

Description

@berquist
berquist
opened on Jan 26, 2016
Issue body actions

Should we be more liberal with the use of the logger? It seems like a very nice thing to have that isn't being taken advantage of. This is all we have right now:

./molproparser.py:467:                            self.logger.warn("setting mocoeff element to zero: %s" % detail)
./molproparser.py:736:            self.logger.info("Creating attribute hessian")
./gaussianparser.py:458:                    self.logger.debug(line)
./gaussianparser.py:621:                self.logger.debug(line)
./gaussianparser.py:626:                    self.logger.error("Problem parsing the value for geometry optimisation: %s is not a number." % parts[2])
./gaussianparser.py:1028:                self.logger.debug(parts)
./gaussianparser.py:1122:                    self.logger.warning("Number of basis functions (nbasis) has changed from %i to %i" % (self.nbasis, nbasis))
./gaussianparser.py:1213:                    self.logger.warning("Molecular coefficients header found but no coefficients.")
./orcaparser.py:190:                self.logger.warning('The geotargets attribute should not exist yet. There is a problem in the parser.')
./orcaparser.py:544:                self.logger.warning(msg)
./orcaparser.py:707:                    self.logger.warning('Overwriting previous multipole moments with new values')
./nwchemparser.py:552:                            self.logger.warning("Symmetry of MO %i has changed" % (index+1))
./nwchemparser.py:905:                self.logger.warning("Found quadrupole moments but no previous dipole")
./nwchemparser.py:960:                self.logger.warning("Found octupole moments but no previous dipole or quadrupole moments")
./nwchemparser.py:963:                self.logger.warning("Found octupole moments but no previous quadrupole moments")
./nwchemparser.py:1021:            self.logger.warning("Found a non-standard aoname representation type.")
./nwchemparser.py:1034:                self.logger.warning(msg)
./gamessparser.py:653:                    self.logger.warning(msg)
./gamessparser.py:658:                    self.logger.warning("\n   " + "\n   ".join((line1, line2, line3)))
./gamessparser.py:886:                    self.logger.warning('MO section found but could not be parsed!')
./gamessparser.py:1076:                            self.logger.warning("Number of occupied orbitals not consistent. This is normal for ECP and FMO jobs.")
./gamessparser.py:1118:                self.logger.info("Reading additional aooverlaps...")
./gamessparser.py:1248:                    self.logger.warning('Overwriting previous multipole moments with new values')
./gamessparser.py:1249:                    self.logger.warning('This could be from post-HF properties or geometry optimization')
./psiparser.py:758:                    self.logger.warning('Overwriting previous multipole moments with new values')
./psiparser.py:759:                    self.logger.warning('This could be from post-HF properties or geometry optimization')
./adfparser.py:121:            self.logger.warning("Skipping remaining calculations")
./adfparser.py:351:                    self.logger.warning("SCF did not converge, so attributes may be missing")
./adfparser.py:355:                self.logger.warning("SCF not fully converged, results acceptable")
./adfparser.py:358:                self.logger.warning("SCF did not converge! moenergies and mocoeffs are unreliable")
./adfparser.py:539:                self.logger.warning("MO info up to #%s is missing" % info[0])
./adfparser.py:1040:                            self.logger.warning("Etsecs are not accurate!")
./adfparser.py:1047:                            self.logger.warning("Etsecs are not accurate!")
./adfparser.py:1128:                    self.logger.warning('Overwriting previous multipole moments with new values')
./logfileparser.py:227:        self.logger = logging.getLogger('%s %s' % (self.logname, self.filename))
./logfileparser.py:228:        self.logger.setLevel(self.loglevel)
./logfileparser.py:229:        if len(self.logger.handlers) == 0:
./logfileparser.py:232:            self.logger.addHandler(handler)
./logfileparser.py:257:                    self.logger.info("Creating attribute %s[]" % name)
./logfileparser.py:259:                    self.logger.info("Creating attribute %s: %s" % (name, str(value)))
./logfileparser.py:415:                self.logger.warning("Attribute %s changed value (%s -> %s)" % (name, getattr(self, name), value))
./logfileparser.py:450:                    self.logger.warning(msg)
./logfileparser.py:461:                        self.logger.warning(msg)

If so, it would be rather tedious to go back to each of the parsers and duplicate the same message everywhere, since most of the messages probably shouldn't be unique to specific parsers or programs. Could there be a way to have a set_attribute hook to spit out a message that's attribute dependent? For example, when setting etenergies, a warning for negative excitation energies, or for vibfreqs, a warning for imaginary frequencies.

At least, when we (eventually) update the documentation, we might want some guidelines on using the logger for people who contribute.

Reacted by Felipe S. S. Schneider

Activity

Next
  1. berquist
    added
    question
    parsers
    on Jan 26, 2016
  2. langner commented on Jan 27, 2016

    @langner
    langner
    on Jan 27, 2016
    Member
    More actions

    Definitely. I agree that verboseness is always a good thing, and you're spot on with the set_attribute trigger. If there's too much output, it can always be modulated with an option/flag.

  3. langner
    added this to the v1.5 milestone on Apr 11, 2016
  4. langner
    modified the milestones: v1.5.1, v1.5 on Aug 19, 2016
  5. langner
    modified the milestones: v1.5.2, v1.5.1 on May 12, 2017
  6. langner
    modified the milestones: v1.5.2, v1.5.3 on Aug 30, 2017
  7. langner
    modified the milestones: v1.5.3, This milestone has been deleted on Apr 4, 2018
  8. langner
    removed this from the v1.5.4 milestone on Aug 26, 2018
  9. 8 remaining items

  10. berquist
    added this to the v1.6.4 milestone on May 6, 2020
  11. langner
    modified the milestones: v1.6.4, v1.6.5 on Oct 6, 2020
  12. langner
    modified the milestones: v1.6.5, v1.7 on Nov 4, 2020
  13. langner
    modified the milestones: v1.7, v1.7.1 on Dec 2, 2020
  14. langner
    modified the milestones: v1.7.1, v1.7.2 on Aug 11, 2021
  15. langner
    modified the milestones: v1.7.2, v1.8 on May 31, 2022
  16. berquist
    modified the milestones: v1.8, v1.8.1 on Jun 13, 2023
  17. berquist
    modified the milestones: v1.8.1, v2.0 on Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good-first-issueparsersquestion

    Type

    No type

    Projects

    No projects

      Milestone

      • v2.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.