class_docstr: A Reporter object that abstracts various logging capabilities
  
  To set-up a Reporter, simply perform the following tasks:
  
  .. code-block:: python
  
      from pyswarms.utils import Reporter
  
      rep = Reporter()
      rep.log("Here's my message", lvl=logging.INFO)
  
  This will set-up a reporter with a default configuration that
  logs to a file, `report.log`, on the current working directory.
  You can change the log path by passing a string to the `log_path`
  parameter:
  
  .. code-block:: python
  
      from pyswarms.utils import Reporter
  
      rep = Reporter(log_path="/path/to/log/file.log")
      rep.log("Here's my message", lvl=logging.INFO)
  
  If you are working on a module and you have an existing logger,
  you can pass that logger instance during initialization:
  
  .. code-block:: python
  
      # mymodule.py
      from pyswarms.utils import Reporter
  
      # An existing logger in a module
      logger = logging.getLogger(__name__)
      rep = Reporter(logger=logger)
  
  Lastly, if you have your own logger configuration (YAML file),
  then simply pass that to the `config_path` parameter. This
  overrides the default configuration (including `log_path`):
  
  .. code-block:: python
  
      from pyswarms.utils import Reporter
  
      rep = Reporter(config_path="/path/to/config/file.yml")
      rep.log("Here's my message", lvl=logging.INFO)
class_docstr_tok: ["A","Reporter","object","that","abstracts","various","logging","capabilities","To","set-up","a","Reporter",",","simply","perform","the","following","tasks",":","..","code-block",":",":","python","from","pyswarms.utils","import","Reporter","rep","=","Reporter","(",")","rep.log","(","``","Here","'s","my","message","''",",","lvl=logging.INFO",")","This","will","set-up","a","reporter","with","a","default","configuration","that","logs","to","a","file",",","`","report.log","`",",","on","the","current","working","directory",".","You","can","change","the","log","path","by","passing","a","string","to","the","`","log_path","`","parameter",":","..","code-block",":",":","python","from","pyswarms.utils","import","Reporter","rep","=","Reporter","(","log_path=","''","\/path\/to\/log\/file.log","''",")","rep.log","(","``","Here","'s","my","message","''",",","lvl=logging.INFO",")","If","you","are","working","on","a","module","and","you","have","an","existing","logger",",","you","can","pass","that","logger","instance","during","initialization",":","..","code-block",":",":","python","#","mymodule.py","from","pyswarms.utils","import","Reporter","#","An","existing","logger","in","a","module","logger","=","logging.getLogger","(","__name__",")","rep","=","Reporter","(","logger=logger",")","Lastly",",","if","you","have","your","own","logger","configuration","(","YAML","file",")",",","then","simply","pass","that","to","the","`","config_path","`","parameter",".","This","overrides","the","default","configuration","(","including","`","log_path","`",")",":","..","code-block",":",":","python","from","pyswarms.utils","import","Reporter","rep","=","Reporter","(","config_path=","''","\/path\/to\/config\/file.yml","''",")","rep.log","(","``","Here","'s","my","message","''",",","lvl=logging.INFO",")"]
docstr: Print a message into console
  
  This method can be called during non-system calls or minor state
  changes. In practice, we call this method when reporting the cost
  on a given timestep.
  
  Parameters
  ----------
  msg : str
      Message to be printed
  verbosity : int
      Verbosity parameter, prints message when it's greater than the
      threshold
  threshold : int, optional
      Threshold parameter, prints message when it's lesser than the
      verbosity. Default is `0`
docstr_tok: ["Print","a","message","into","console","This","method","can","be","called","during","non-system","calls","or","minor","state","changes",".","In","practice",",","we","call","this","method","when","reporting","the","cost","on","a","given","timestep",".","Parameters","--","--","--","--","--","msg",":","str","Message","to","be","printed","verbosity",":","int","Verbosity","parameter",",","prints","message","when","it","'s","greater","than","the","threshold","threshold",":","int",",","optional","Threshold","parameter",",","prints","message","when","it","'s","lesser","than","the","verbosity",".","Default","is","`","0","`"]
code: def print(self, msg, verbosity, threshold=0):
      """Print a message into console
  
      This method can be called during non-system calls or minor state
      changes. In practice, we call this method when reporting the cost
      on a given timestep.
  
      Parameters
      ----------
      msg : str
          Message to be printed
      verbosity : int
          Verbosity parameter, prints message when it's greater than the
          threshold
      threshold : int, optional
          Threshold parameter, prints message when it's lesser than the
          verbosity. Default is `0`
      """
      if verbosity > threshold:
          self.printer.pprint(msg)
      else:
          pass
  
file_path: pyswarms/pyswarms/utils/reporter/reporter.py
imports: import logging
  import logging.config
  import os
  import pprint
  import yaml
  from tqdm import trange
label_desc: Use image node_id 3 for calling the Reporter obj's underlying member method code with example usage: obj.print(msg, verbosity, threshold) without return types