<commit_before>package travix.loggers;

class FlashLogger {
  static var printBuf = new StringBuf();
  public static function print(s:String) {
    // print without newline is not supported on flash,
    // we try to emulate that by storing the text in a buffer and print them at a println call
    printBuf.add(s);
  }
  
  public static function println(s:String) {
    var pending = printBuf.toString();
    flash.Lib.trace(pending + s);
    if(pending.length > 0)
      printBuf = new StringBuf();
  }
  
  public static function exit(code:Int) {
    flash.system.System.exit(code);
  }
  
}<commit_msg>Flush buf on exit<commit_after>package travix.loggers;

class FlashLogger {
  static var printBuf = new StringBuf();
  public static function print(s:String) {
    // print without newline is not supported on flash,
    // we try to emulate that by storing the text in a buffer and print them at a println call
    printBuf.add(s);
  }
  
  public static function println(s:String) {
    var pending = printBuf.toString();
    flash.Lib.trace(pending + s);
    if(pending.length > 0)
      printBuf = new StringBuf();
  }
  
  public static function exit(code:Int) {
    if(printBuf.length > 0) flash.Lib.trace(printBuf.toString());
    flash.system.System.exit(code);
  }
  
}
{'fraction_non_alphanumeric': 0.102803738317757, 'fraction_numerical': 0.002336448598130841, 'mean_word_length': 3.1993464052287583, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7228605', 'n_tokens_mistral': 402, 'n_tokens_neox': 395, 'n_words': 126}