code: def action_logger(logger, loglevel="info"):
      def decorator(func):
          def wrapper(*args, **kwargs):
              log_func = getattr(logger, loglevel)
              instance = args[0]
              log_func(
                  "%s.%s: calling with args - %s, kwargs - %s",
                  instance.__class__.__name__,
                  func.__name__,
                  args[1:],
                  kwargs,
              )
              res = func(*args, **kwargs)
              log_func(
                  "%s.%s: returning - %s",
                  instance.__class__.__name__,
                  func.__name__,
                  res,
              )
              return res
  
          return wrapper
  
      return decorator
  
imports: import time
  import importlib
  from threading import Thread
  import requests
  from mindsdb.utilities import log
label_desc: Use image node_id 1 for calling a global function with example usage: action_logger(logger, loglevel) and returns: decorator, wrapper, res