<commit_before>require 'json'
require 'rainbow/ext/string'

command :logs do |c|
  c.syntax = %{mr logs [options]}
  c.description = %{Get the logs for a solution}
  c.option '-f','--follow', %{Follow logs from server}
  c.option('--[no-]color', %{Toggle colorizing of logs}) {
    Rainbow.enabled = false
  }
  c.option '--[no-]pretty', %{Reformat JSON blobs in logs.}

  c.action do |args,options|
    options.default :pretty=>true

    sol = MrMurano::Solution.new
    ret = sol.get('/logs') # TODO: ('/logs?polling=true')

    if ret.kind_of?(Hash) and ret.has_key?('items') then
      ret['items'].reverse.each do |line|<commit_msg>Remove --follow; doesn't work yet.<commit_after>require 'json'
require 'rainbow/ext/string'

command :logs do |c|
  c.syntax = %{mr logs [options]}
  c.description = %{Get the logs for a solution}
  #c.option '-f','--follow', %{Follow logs from server}
  c.option('--[no-]color', %{Toggle colorizing of logs}) {
    Rainbow.enabled = false
  }
  c.option '--[no-]pretty', %{Reformat JSON blobs in logs.}

  c.action do |args,options|
    options.default :pretty=>true

    sol = MrMurano::Solution.new
    ret = sol.get('/logs') # TODO: ('/logs?polling=true') Currently ignored.

    if ret.kind_of?(Hash) and ret.has_key?('items') then
      ret['items'].reverse.each do |line|
{'fraction_non_alphanumeric': 0.17870722433460076, 'fraction_numerical': 0.0, 'mean_word_length': 3.617543859649123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5407638', 'n_tokens_mistral': 473, 'n_tokens_neox': 440, 'n_words': 121}