Nate Lockwood
Nate Lockwood

Reputation: 3655

Dart Can't get logging statements to compile

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 {
}

Upvotes: 1

Views: 61

Answers (1)

Pixel Elephant
Pixel Elephant

Reputation: 21383

It looks like the class was changed to LogPrintHandler but the tutorial and documentation were not updated.

Upvotes: 3

Related Questions