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: Log a message within a set level
  
  This method abstracts the logging.Logger.log() method. We use this
  method during major state changes, errors, or critical events during
  the optimization run.
  
  You can check logging levels on this `link`_. In essence, DEBUG is 10,
  INFO is 20, WARNING is 30, ERROR is 40, and CRITICAL is 50.
  
  .. _link: https://docs.python.org/3/library/logging.html#logging-levels
  
  Parameters
  ----------
  msg : str
      Message to be logged
  lvl : int, optional
      Logging level. Default is `logging.INFO`
docstr_tok: ["Log","a","message","within","a","set","level","This","method","abstracts","the","logging.Logger.log","(",")","method",".","We","use","this","method","during","major","state","changes",",","errors",",","or","critical","events","during","the","optimization","run",".","You","can","check","logging","levels","on","this","`","link","`","_",".","In","essence",",","DEBUG","is","10",",","INFO","is","20",",","WARNING","is","30",",","ERROR","is","40",",","and","CRITICAL","is","50",".","..","_link",":","https",":","\/\/docs.python.org\/3\/library\/logging.html","#","logging-levels","Parameters","--","--","--","--","--","msg",":","str","Message","to","be","logged","lvl",":","int",",","optional","Logging","level",".","Default","is","`","logging.INFO","`"]
code: def log(self, msg, lvl=logging.INFO, *args, **kwargs):
      """Log a message within a set level
  
      This method abstracts the logging.Logger.log() method. We use this
      method during major state changes, errors, or critical events during
      the optimization run.
  
      You can check logging levels on this `link`_. In essence, DEBUG is 10,
      INFO is 20, WARNING is 30, ERROR is 40, and CRITICAL is 50.
  
      .. _link: https://docs.python.org/3/library/logging.html#logging-levels
  
      Parameters
      ----------
      msg : str
          Message to be logged
      lvl : int, optional
          Logging level. Default is `logging.INFO`
      """
      self.logger.log(lvl, msg, *args, **kwargs)
  
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 2 for calling the Reporter obj's underlying member method code with example usage: obj.log(msg, lvl) without return types