code: def _log (fun, msg, args, **kwargs):
      
      fun(msg, *args)
      if kwargs.get("traceback"):
          # note: get rid of last parts of the stack
          fun(_stack_format(inspect.stack()[2:]))
      if kwargs.get("exception"):
          fun(traceback.format_exc())
docs: Log a message with given function. Optional the following keyword
      arguments are supported:
      traceback(bool) - if True print traceback of current function
      exception(bool) - if True print last exception traceback
  
      @return: None