class_docstr: The ``Logger`` class is the ClearML console log and metric statistics interface, and contains methods for explicit
  reporting.
  
  Explicit reporting extends ClearML automagical capturing of inputs and output. Explicit reporting
  methods include scalar plots, line plots, histograms, confusion matrices, 2D and 3D scatter
  diagrams, text logging, tables, and image uploading and reporting.
  
  In the **ClearML Web-App (UI)**, ``Logger`` output appears in the **RESULTS** tab, **CONSOLE**, **SCALARS**,
  **PLOTS**, and **DEBUG SAMPLES** sub-tabs. When you compare experiments, ``Logger`` output appears in the
  comparisons.
  
  .. warning::
  
     Do not construct Logger objects directly.
  
  You must get a Logger object before calling any of the other ``Logger`` class methods by calling
  :meth:`.Task.get_logger` or :meth:`Logger.current_logger`.
class_docstr_tok: ["The","``","Logger","``","class","is","the","ClearML","console","log","and","metric","statistics","interface",",","and","contains","methods","for","explicit","reporting",".","Explicit","reporting","extends","ClearML","automagical","capturing","of","inputs","and","output",".","Explicit","reporting","methods","include","scalar","plots",",","line","plots",",","histograms",",","confusion","matrices",",","2D","and","3D","scatter","diagrams",",","text","logging",",","tables",",","and","image","uploading","and","reporting",".","In","the","*","*","ClearML","Web-App","(","UI",")","*","*",",","``","Logger","``","output","appears","in","the","*","*","RESULTS","*","*","tab",",","*","*","CONSOLE","*","*",",","*","*","SCALARS","*","*",",","*","*","PLOTS","*","*",",","and","*","*","DEBUG","SAMPLES","*","*","sub-tabs",".","When","you","compare","experiments",",","``","Logger","``","output","appears","in","the","comparisons",".","..","warning",":",":","Do","not","construct","Logger","objects","directly",".","You","must","get","a","Logger","object","before","calling","any","of","the","other","``","Logger","``","class","methods","by","calling",":","meth",":","`",".Task.get_logger","`","or",":","meth",":","`","Logger.current_logger","`","."]
docstr: print text to log (same as print to console, and also prints to console)
  
  :param msg: text to print to the console (always send to the backend and displayed in console)
  :param level: logging level, default: logging.INFO
  :param omit_console: Omit the console output, and only send the ``msg`` value to the log
  :param force_send: Report with an explicit log level. Only supported if ``omit_console`` is True
  
      - ``True`` - Omit the console output.
      - ``False`` - Print the console output. (default)
docstr_tok: ["print","text","to","log","(","same","as","print","to","console",",","and","also","prints","to","console",")",":","param","msg",":","text","to","print","to","the","console","(","always","send","to","the","backend","and","displayed","in","console",")",":","param","level",":","logging","level",",","default",":","logging.INFO",":","param","omit_console",":","Omit","the","console","output",",","and","only","send","the","``","msg","``","value","to","the","log",":","param","force_send",":","Report","with","an","explicit","log","level",".","Only","supported","if","``","omit_console","``","is","True","-","``","True","``","-","Omit","the","console","output",".","-","``","False","``","-","Print","the","console","output",".","(","default",")"]
code: def _console(
      self,
      msg,
      level=logging.INFO,
      omit_console=False,
      force_send=False,
      *args,
      **_,
  ):
      # type: (str, int, bool, bool, Any, Any) -> None
      """
      print text to log (same as print to console, and also prints to console)
  
      :param msg: text to print to the console (always send to the backend and displayed in console)
      :param level: logging level, default: logging.INFO
      :param omit_console: Omit the console output, and only send the ``msg`` value to the log
      :param force_send: Report with an explicit log level. Only supported if ``omit_console`` is True
  
          - ``True`` - Omit the console output.
          - ``False`` - Print the console output. (default)
  
      """
      level = self._parse_level(level)
  
      force_send = force_send and omit_console
  
      # noinspection PyProtectedMember
      if (
          not self._skip_console_log()
          or not self._task._is_remote_main_task()
          or force_send
      ):
          # check if we have a TaskHandler and that it is valid (shutdown will clear the .task_id)
          if self._task_handler and self._task_handler.task_id:
              # noinspection PyBroadException
              try:
                  record = self._task.log.makeRecord(
                      "console",
                      level=level,
                      fn="",
                      lno=0,
                      func="",
                      msg=msg,
                      args=args,
                      exc_info=None,
                  )
                  # find the task handler that matches our task
                  self._task_handler.emit(record)
              except Exception:
                  # avoid infinite loop, output directly to stderr
                  # noinspection PyBroadException
                  try:
                      # make sure we are writing to the original stdout
                      StdStreamPatch.stderr_original_write(
                          'clearml.Logger failed sending log [level {}]: "{}"\n'.format(
                              level, msg
                          )
                      )
                  except Exception:
                      pass
          else:
              # noinspection PyProtectedMember
              self._task._reporter.report_console(
                  message=msg, level=level
              )
  
      if not omit_console:
          # if we are here and we grabbed the stdout, we need to print the real thing
          if self._connect_std_streams and not self._skip_console_log():
              # noinspection PyBroadException
              try:
                  # make sure we are writing to the original stdout
                  StdStreamPatch.stdout_original_write(str(msg) + "\n")
              except Exception:
                  pass
          else:
              print(str(msg))
  
      # if task was not started, we have to start it
      self._start_task_if_needed()
  
imports: import logging
  import math
  import warnings
  from typing import Any, Sequence, Union, List, Optional, Tuple, Dict, TYPE_CHECKING
  import numpy
  import six
  from PIL import Image
  from pathlib2 import Path
  from .debugging.log import LoggerRoot
  from .backend_interface.logger import StdStreamPatch
  from .backend_interface.task import Task
  from .backend_interface.task.log import TaskHandler
  from .backend_interface.util import mutually_exclusive
  from .backend_interface.metrics.events import UploadEvent, MetricsEventAdapter
  from .config import running_remotely, get_cache_dir, config, DEBUG_SIMULATE_REMOTE_TASK, deferred_config
  from .errors import UsageError
  from .storage.helper import StorageHelper
  from .utilities.plotly_reporter import SeriesInfo
label_desc: Use image node_id 35 for calling the Logger obj's underlying member method code with example usage: obj._console(msg, level, omit_console, force_send) without return types