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: Create a tqdm iterable
  
  You can use this method to create progress bars. It uses a set
  of abstracted methods from tqdm:
  
  .. code-block:: python
  
      from pyswarms.utils import Reporter
  
      rep = Reporter()
      # Create a progress bar
      for i in rep.pbar(100, name="Optimizer")
              pass
  
  Parameters
  ----------
  iters : int
      Maximum range passed to the tqdm instance
  desc : str, optional
      Name of the progress bar that will be displayed
  
  Returns
  -------
  :obj:`tqdm._tqdm.tqdm`
      A tqdm iterable
docstr_tok: ["Create","a","tqdm","iterable","You","can","use","this","method","to","create","progress","bars",".","It","uses","a","set","of","abstracted","methods","from","tqdm",":","..","code-block",":",":","python","from","pyswarms.utils","import","Reporter","rep","=","Reporter","(",")","#","Create","a","progress","bar","for","i","in","rep.pbar","(","100",",","name=","''","Optimizer","''",")","pass","Parameters","--","--","--","--","--","iters",":","int","Maximum","range","passed","to","the","tqdm","instance","desc",":","str",",","optional","Name","of","the","progress","bar","that","will","be","displayed","Returns","--","--","--","-",":","obj",":","`","tqdm._tqdm.tqdm","`","A","tqdm","iterable"]
code: def pbar(self, iters, desc=None):
      """Create a tqdm iterable
  
      You can use this method to create progress bars. It uses a set
      of abstracted methods from tqdm:
  
      .. code-block:: python
  
          from pyswarms.utils import Reporter
  
          rep = Reporter()
          # Create a progress bar
          for i in rep.pbar(100, name="Optimizer")
                  pass
  
      Parameters
      ----------
      iters : int
          Maximum range passed to the tqdm instance
      desc : str, optional
          Name of the progress bar that will be displayed
  
      Returns
      -------
      :obj:`tqdm._tqdm.tqdm`
          A tqdm iterable
      """
      self.t = trange(iters, desc=desc, bar_format=self._bar_fmt)
      return self.t
  
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 6 for calling the Reporter obj's underlying member method code with example usage: obj.pbar(iters, desc) and returns: self