code: def log_elapsed_time(logger, level, output_msg=None):
      if output_msg is None:
          output_msg = "Elapsed time ->:\n{elapsed_time}"
  
      def get_wrapper(fn):
          @wraps(fn)
          def wrapped(*args, **kwargs):
              start = datetime.now()
              msg_fmt = dict()
              res = fn(*args, **kwargs)
              if "elapsed_time" in output_msg:
                  msg_fmt["elapsed_time"] = datetime.now() - start
              logger.log(level, output_msg.format(**msg_fmt))
              return res
  
          return wrapped
  
      return get_wrapper
  
file_path: snips-nlu/snips_nlu/common/log_utils.py
imports: from __future__ import unicode_literals
  from builtins import str
  from datetime import datetime
  from functools import wraps
  from snips_nlu.common.utils import json_debug_string
label_desc: Use image node_id 1 for calling a global function with example usage: log_elapsed_time(logger, level, output_msg) and returns: get_wrapper, wrapped, res