Dart Can't get logging statements to compile

Posted by Nate Lockwood on Stack Overflow See other posts from Stack Overflow or by Nate Lockwood
Published on 2014-06-10T21:08:14Z Indexed on 2014/06/10 21:24 UTC
Read the original article Hit count: 152

Filed under:

I'm trying to learn how to implement logging using the examples/tutorial in:

http://blog.dartwatch.com/2013/05/campaign-to-use-real-logging-instead-of.html#comment-form

But having imported the libraries this line in main will not compile because the class 'PrintHandler' is not recognized and Google has not been a help in this case. My server application consists of a main and three classes. I'm new at Dart. Below I've extracted the logging code that I added.

In what library is 'PrintHandler'? Is this a class I need to write?

library server;

import 'package:logging_handlers/logging_handlers_shared.dart';
import 'package:logging/logging.dart';

final _serverLogger = new Logger("server"); // top level logger

void main() {
  Logger.root.onRecord.listen(new PrintHandler()); // default PrintHandler
  _serverLogger.fine("Server created");
}

class A {
}

class B {
}

class C {
}

© Stack Overflow or respective owner

Related posts about dart