code: def logs(environment, opts):
      
      container = 'web'
      if opts['--solr']:
          container = 'solr'
      if opts['--postgres']:
          container = 'postgres'
      if opts['--datapusher']:
          container = 'datapusher'
      tail = opts['--tail']
      if tail != 'all':
          tail = int(tail)
      l = environment.logs(container, tail, opts['--follow'],
          opts['--timestamps'])
      if not opts['--follow']:
          print l
          return
      try:
          for message in l:
              write(message)
      except KeyboardInterrupt:
          print
docs: Display or follow container logs
  
  Usage:
    datacats logs [--postgres | --solr | --datapusher] [-s NAME] [-tr] [--tail=LINES] [ENVIRONMENT]
    datacats logs -f [--postgres | --solr | --datapusher] [-s NAME] [-r] [ENVIRONMENT]
  
  Options:
    --datapusher       Show logs for datapusher instead of web logs
    --postgres         Show postgres database logs instead of web logs
    -f --follow        Follow logs instead of exiting immediately
    --solr             Show solr search logs instead of web logs
    -t --timestamps    Add timestamps to log lines
    -s --site=NAME     Specify a site for logs if needed [default: primary]
    --tail=LINES       Number of lines to show [default: all]
  
  ENVIRONMENT may be an environment name or a path to an environment directory.
  Default: '.'