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

A logging decorator, that will log if function was unsucesful #4

Open
NegaScout opened this issue Apr 23, 2023 · 1 comment
Open

A logging decorator, that will log if function was unsucesful #4

NegaScout opened this issue Apr 23, 2023 · 1 comment
Labels
decorator A decorator to implement todo a task that needs resolving vision A vision of a feature, very rough draft

Comments

@NegaScout
Copy link
Owner

NegaScout commented Apr 23, 2023

based on internal decorator variable, decide if function was a succes, and if not, the reason for failing

def log( fun, *args, **kwargs):
  succes = True
  log_on_succes = False
  description = 'Default description'
  log_level = 'info'
  ret = fun(*args, **kwargs)
  if not succes:
     self.logger.log(description)
  elif succes and log_on_succes:
    self.logger.log(description)
  return ret
@NegaScout NegaScout added vision A vision of a feature, very rough draft todo a task that needs resolving decorator A decorator to implement labels Apr 23, 2023
@NegaScout
Copy link
Owner Author

Implemented draft in fbbe4eb, not fully tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decorator A decorator to implement todo a task that needs resolving vision A vision of a feature, very rough draft
Projects
None yet
Development

No branches or pull requests

1 participant