title: Disable print() in Dart
body: <p>Is there a way to disable the print function Dart code or somehow intercept it?
  Some devs on our team keep on using print instead of the logger we built which means we see a lot of garbage in the console that we have no way of switching off unless we do a search replace through all the code to find 
  and replace <code>print(String)</code> with <code>log.info(String)</code></p>
  
  <p>Ideally we should be using a pre-commit hook to check if the committed code contains prints and then reject the commit, but it seems quicker to just block the print at code-level.</p>
  
  <pre><code>// Copyright (c) 2012, 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.
  
  part of dart.core;
  
  /// Prints a string representation of the object to the console.
  void print(Object object) {
    String line = "$object";
    if (printToZone == null) {
      printToConsole(line);
    } else {
      printToZone(line);
    }
  }
  </code></pre>
  
  <p><code>print</code> is part of <code>dart.core</code>, is it possible to override anything in <code>dart.core</code> either via code or via some transformer in <code>pubspec.yaml</code>?</p>
  
  <p>If not, I guess it's time to go setup that pre-commit hook.</p>