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: .. warning::
      **Do not construct Logger manually!**
      Please use :meth:`Logger.get_current`
docstr_tok: ["..","warning",":",":","*","*","Do","not","construct","Logger","manually","!","*","*","Please","use",":","meth",":","`","Logger.get_current","`"]
code: def __init__(
      self,
      private_task,
      connect_stdout=True,
      connect_stderr=True,
      connect_logging=False,
  ):
      """
      .. warning::
          **Do not construct Logger manually!**
          Please use :meth:`Logger.get_current`
      """
      assert isinstance(
          private_task, _Task
      ), "Logger object cannot be instantiated externally, use Logger.current_logger()"
      super(Logger, self).__init__()
      self._task = private_task
      self._default_upload_destination = None
      self._flusher = None
      self._report_worker = None
      self._graph_titles = {}
      self._tensorboard_series_force_prefix = None
      self._task_handler = (
          TaskHandler(task=self._task, capacity=100)
          if private_task.is_main_task()
          or (connect_stdout or connect_stderr or connect_logging)
          else None
      )
      self._connect_std_streams = connect_stdout or connect_stderr
      self._connect_logging = connect_logging
      self._default_max_sample_history = None
  
      # Make sure urllib is never in debug/info,
      disable_urllib3_info = config.get(
          "log.disable_urllib3_info", True
      )
      if disable_urllib3_info and logging.getLogger(
          "urllib3"
      ).isEnabledFor(logging.INFO):
          logging.getLogger("urllib3").setLevel(logging.WARNING)
  
      if self._task.is_main_task():
          StdStreamPatch.patch_std_streams(
              self,
              connect_stdout=connect_stdout,
              connect_stderr=connect_stderr,
          )
  
      if self._connect_logging:
          StdStreamPatch.patch_logging_formatter(self)
      elif not self._connect_std_streams and self._task.is_main_task():
          # make sure that at least the main clearml logger is connect
          base_logger = LoggerRoot.get_base_logger()
          if base_logger and base_logger.handlers:
              StdStreamPatch.patch_logging_formatter(
                  self, base_logger.handlers[0]
              )
  
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 1 to create a new Logger object from inherited base classes: object with example: obj = Logger(private_task, connect_stdout, connect_stderr, connect_logging)