code: def message(self, msg, cr="\n"):
      from datalad.log import no_progress
  
      with no_progress():
          try:
              self.out.write(msg)
          except UnicodeEncodeError as e:
              # all unicode magic has failed and the receiving end cannot handle
              # a particular unicode char. rather than crashing, we replace the
              # offending chars to be able to message at least something, and we
              # log that we did that
              encoding = self.out.encoding
              lgr.debug(
                  "Replacing unicode chars in message output for display: %s",
                  e,
              )
              self.out.write(
                  msg.encode(encoding, "replace").decode(encoding)
              )
          if cr:
              self.out.write(cr)
  
imports: from logging import getLogger
  import os
  import sys
  import time
  import getpass
  from collections import deque
  from copy import copy
  from ..utils import auto_repr
  from ..utils import on_windows
  from .base import InteractiveUI
  from datalad.support.exceptions import CapturedException
label_desc: Use image node_id 2 for calling the ConsoleLog obj's underlying member method code with example usage: obj.message(msg, cr) without return types