Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding more informative logs into the framework #695

Open
KonsKo opened this issue Oct 3, 2024 · 0 comments
Open

Adding more informative logs into the framework #695

KonsKo opened this issue Oct 3, 2024 · 0 comments
Assignees

Comments

@KonsKo
Copy link
Contributor

KonsKo commented Oct 3, 2024

Currently, we log not much actions that happen during the framework work. And some of them are not informative at all.

Let's consider an example from helpers/stateful.py

Method start from class Stateful

    def start(self, obj=""):
        """Try to start object"""
        if self.state != STATE_STOPPED:
            if obj == "":
                tf_cfg.dbg(3, "Not stopped")
            else:
                tf_cfg.dbg(3, "%s not stopped" % obj)
            return
        self.state = STATE_BEGIN_START
        self._exceptions = list()
        self.run_start()
        self.state = STATE_STARTED

class Stateful is parent for many other classes.
Here, we do not have any logged information about what is happening, I mean, information, that we beginning start and for what, information about states, information, that we finished start successfully for what, etc.
Also, line such tf_cfg.dbg(3, "Not stopped") is not informative at all, as I mentioned, class Stateful is parent for many other classes, and if this log is involved, we do not have any information.

In opposite, in some places we have duplicated logs such:

24-10-03 22:37:00.555500 WARNING   |      lxc cmd: sudo lxc list -f json                                                                                                                                                                       tf_cfg.py:245
24-10-03 22:37:00.556650 INFO      |      Run command 'sudo lxc list -f json' on host localhost with environment {} 

It is hard to debug problems during the work.

  • we need to log every important action
  • we need to have informative logs
  • we need to remove logs duplicates
  • we need to set correct log levels
@RomanBelozerov RomanBelozerov added this to the 0.9 (LA) for tests milestone Oct 22, 2024
@RomanBelozerov RomanBelozerov self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants