src/commands/logs.js
/**
   * Register the pusher websocket and handler for new logs coming in
   */
Register the pusher websocket and handler for new logs coming in
Register the pusher websocket and handler for new logs coming in
registerLogFeed() {
    const {flags: {domain, utc}} = this.parse(LogsCommand)
    const feed = new LogFeed()
    feed.onLog(log => {
      const entry = new LogEntry(log, domain)
      if (this.canLog) {
        this.spinner(null)
        this.log(entry.formattedSummary(utc))
        entry.setPrinted()
        this.spinner('Listening for logs from Chec. Press "up" to navigate through the existing logs')
        this.pruneLogs()
      }
      this.logs.push(entry)
    })
    this.logFeed = feed
  }
registerLogFeed ( ) { const { flags : { domain , utc } } = this . parse ( LogsCommand ) const feed = new LogFeed ( ) feed . onLog ( log => { const entry = new LogEntry ( log , domain ) if ( this . canLog ) { this . spinner ( null ) this . log ( entry . formattedSummary ( utc ) ) entry . setPrinted ( ) this . spinner ( 'Listening for logs from Chec. Press "up" to navigate through the existing logs' ) this . pruneLogs ( ) } this . logs . push ( entry ) } ) this . logFeed = feed }
Register the pusher websocket and handler for new logs coming in
Register the pusher websocket and handler for new logs coming in
// Check if we're waiting // Stop the spinner // Print the line // Restart the spinner // Keep logs pruned // Append the log