code: def setup_logging(name, prefix="trademanager", cfg=None):
      
      logname = "/var/log/%s/%s_tapp.log" % (prefix, name)
      logfile = cfg.get('log', 'LOGFILE') if cfg is not None and \
          cfg.get('log', 'LOGFILE') is not None and cfg.get('log', 'LOGFILE') != "" else logname
      loglevel = cfg.get('log', 'LOGLEVEL') if cfg is not None and \
          cfg.get('log', 'LOGLEVEL') is not None else logging.INFO
      logging.basicConfig(filename=logfile, level=loglevel)
      return logging.getLogger(name)
docs: Create a logger, based on the given configuration.
      Accepts LOGFILE and LOGLEVEL settings.
  
      :param name: the name of the tapp to log
      :param cfg: The configuration object with logging info.
      :return: The session and the engine as a list (in that order)