<commit_before>// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library file_instrumentation;

import 'dart:io';

import 'package:analyzer/instrumentation/instrumentation.dart';

/**
 * An [InstrumentationServer] that writes to a file.
 */
class FileInstrumentationServer implements InstrumentationServer {
  IOSink _sink;

  FileInstrumentationServer(String path) {
    File file = new File(path);
    _sink = file.openWrite(mode: FileMode.APPEND);
  }

  @override
  void log(String message) {
    _sink.writeln(message);
  }

  @override
  void logWithPriority(String message) {
    log(message);
  }

  @override
  void shutdown() {
    _sink.close();
    _sink = null;
  }
}<commit_msg>Overwrite local instrumentation file.<commit_after>// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library file_instrumentation;

import 'dart:io';

import 'package:analyzer/instrumentation/instrumentation.dart';

/**
 * An [InstrumentationServer] that writes to a file.
 */
class FileInstrumentationServer implements InstrumentationServer {
  IOSink _sink;

  FileInstrumentationServer(String path) {
    File file = new File(path);
    _sink = file.openWrite();
  }

  @override
  void log(String message) {
    _sink.writeln(message);
  }

  @override
  void logWithPriority(String message) {
    log(message);
  }

  @override
  void shutdown() {
    _sink.close();
    _sink = null;
  }
}
{'fraction_non_alphanumeric': 0.09703660662405578, 'fraction_numerical': 0.004648460197559558, 'mean_word_length': 3.796657381615599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6984898', 'n_tokens_mistral': 550, 'n_tokens_neox': 525, 'n_words': 164}