code: def _get_stack_depth(package, fqdn, defdepth=_def_stackdepth):
      
      global _stack_config
      if package not in _stack_config:
          from acorn.config import settings
          spack = settings(package)
          _stack_config[package] = {}
  
          secname = "logging.depth"
          if spack.has_section(secname):
              for ofqdn in spack.options(secname):
                  _stack_config[package][ofqdn] = spack.getint(secname, ofqdn)
  
      usedef = True
      if fqdn in _stack_config[package]:
          result = _stack_config[package][fqdn]
          usedef = False
      elif "*" in _stack_config[package]: # pragma: no cover
          result = _stack_config[package]["*"]
          usedef = False
      else:
          result = defdepth
  
      if not usedef:
          msg.gen("Using {} for {} stack depth.".format(result, fqdn), 3)
      return result
docs: Loads the stack depth settings from the config file for the specified
      package.
  
      Args:
          package (str): name of the package to get stack depth info for.
          fqdn (str): fully qualified domain name of the member in the package.
          defdepth (int): default depth when one has not been configured.