docs: def creationlog(base, package, stackdepth=_def_stackdepth):
      """Decorator for wrapping the creation of class instances that are being logged
      by acorn.
  
      Args:
          base: base class used to call __new__ for the construction.
          package (str): name of (global) package the class belongs to.
          stackdepth (int): if the calling stack is less than this depth, than
            include the entry in the log; otherwise ignore it.
      """   
      @staticmethod
      def wrapnew(cls, *argl, **argd):
          global _atdepth_new, _cstack_new, streamlining
          origstream = None
          if not (decorating or streamlining):
              entry, _atdepth_new = _pre_create(cls, _atdepth_new,
                                                stackdepth, *argl, **argd)
              _cstack_new.append(cls)
  
              #See if we need to enable streamlining for this constructor.
              fqdn = cls.__fqdn__
              if fqdn in _streamlines and _streamlines[fqdn]:
                  #We only use streamlining for the plotting routines at the
                  #moment, so it doesn't get hit by the unit tests.
                  msg.std("Streamlining {}.".format(fqdn), 2)
                  origstream = streamlining
                  streamlining = True
              
          try:
              if six.PY2:
                  result = base.__old__(cls, *argl, **argd)
              else: # pragma: no cover
                  #Python 3 changed the way that the constructors behave. In cases
                  #where a class inherits only from object, and doesn't override
                  #the __new__ method, the __old__ we replaced was just the one
                  #belonging to object.
                  if base.__old__ is object.__new__:
                      result = base.__old__(cls)
                  else:
                      result = base.__old__(cls, *argl, **argd)
                      
          except TypeError: # pragma: no cover
              #This is a crazy hack! We want this to be dynamic so that it can
              #work with any of the packages. If the error message suggests using
              #a different constructor, we go ahead and use it.
              import sys
              xcls, xerr = sys.exc_info()[0:2]
              referral = xerr.args[0].split()[-1]
              if ".__new__()" in referral:
                  t = eval(referral.split('.')[0])
                  result = t.__new__(cls, *argl, **argd)
              else:
                  raise
                  result = None
  
          if result is not None and hasattr(cls, "__init__"):
              try:
                  cls.__init__(result, *argl, **argd)
              except: # pragma: no cover
                  print(cls, argl, argd)
                  raise
          else: # pragma: no cover
              msg.err("Object initialize failed for {}.".format(base.__name__))
  
          #If we don't disable streamlining for the original method that set
          #it, then the post call would never be reached.
          if origstream is not None:
              #We avoid another dict lookup by checking whether we set the
              #*local* origstream to something above.
              streamlining = origstream
              
          if not (decorating or streamlining):
              _cstack_new.pop()
              if len(_cstack_new) == 0:
                  _atdepth_new = False
              _post_create(_atdepth_new, entry, result)
                          
          return result
      return wrapnew