If I run:
#!/home/jim/dart/dart-sdk/bin/dart
#import('logging');
Logger log = new Logger('');
void main() {
log.warn("Hello, world!\n");
}
I get:
Unable to open file: /home/jim/Code/dart/test/logging’file:///home/jim/Code/dart/test/test-log.dart’:
Error: line 3 pos 1: library handler failed
Do I need to install the logger library? Where can I find it? How do I import it?
Use pub, the package manager for Dart.
In your pubspec.yaml, make sure you have a line for logging in the dependencies section:
Then run
pub install, either in the Editor (Tools->Pub Install), or from the command line (./dart/dart-sdk/bin/pub install)Then you can import logging with the
package:scheme: