YouTubeViews- icon indicating copy to clipboard operation
YouTubeViews- copied to clipboard

Switch to console-logging instead of relying on Color Coding

Open cuuupid opened this issue 8 years ago • 0 comments

Instead of something like this:

 def display(self, url):
  n = '\033[0m'  # null ---> reset
  r = '\033[31m' # red
  g = '\033[32m' # green
  y = '\033[33m' # yellow
  b = '\033[34m' # blue

  call('clear')
  print ''
  print '  +------ Youtube Views ------+'
  print '  [-] Url: {}{}{}'.format(g, url, n)
  print '  [-] Proxy IP: {}{}{}'.format(b, self.ip, n)
  print '  [-] Visits: {}{}{}'.format(y, self.targets[url], n)

It may be more suitable to use a logging utility such as console-logging:

from console_logging.console import Console
console = Console()

def display(self, url):
    call('clear')
    console.info('+------ Youtube Views ------+')
    console.log('URL: %s ' % url)
    console.log('Proxy IP: %s' % self.ip)
    console.success('Visits: %d' % self.targets[url])

Utilities such as this and logger also have error and other easy color-coded debugging, as well as timestamps which could be useful for bots like this. Just a suggestion! 😃 Cool work!

cuuupid avatar Jan 11 '18 02:01 cuuupid