angular-dev-logger
angular development & production mode log support module
Last updated 3 years ago by kernyoo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install angular-dev-logger 
SYNC missed versions from official npm registry.

Angular-dev-logger

Angular ver1.0 logger module. window.console control using $devLoggerProvider module.

version

0.1.0

install

npm install

You can install using npm

npm install angular-dev-logger --save-dev
yarn install angular-dev-logger --dev

donwload source

import script source(HTML)

<script src="path/to/angular-dev-logger.js"></script>

using common js

require('angular-dev-logger');

usage

add dependecy on angular app

If you import source and using common js, add angular-dev-logger dependency on your angular app.

require('angular-dev-logger');

angular.module('myApp', [
  'angular-dev-logger'
]);

DebugMode

If you handle debugmode using angular-dev-logger, use angular config module.

angular.module('myApp').config(function ($devLoggerProvider) {
});

If you $devLoggerProvider is true, you can use window.console function.

angular.module('myApp').config(function ($devLoggerProvider) {
  $devLoggerProvider.debugMode(true);
});

//controller.js
angular.module('myApp').controller('myController', function () {
  console.log('logger log'); //logger log
  console.error('logger error'); //logger error
  console.info('logger info'); //logger info
});

If you $devLoggerProvider is false, window.console function is not operate.

//config js
angular.module('myApp').config(function ($devLoggerProvider) {
  $devLoggerProvider.debugMode(false);
});

//controller.js
angular.module('myApp').controller('myController', function () {
  console.log('logger log'); //not operate
  console.error('logger error'); //not operate
  console.info('logger info'); //not operate
});

License

MIT © KernYoo

Current Tags

  • 0.2.1                                ...           latest (3 years ago)

3 Versions

  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |