icemobilelab/virgilio — pull request #26 by NinjaTux (2014-06-18 15:55:22+00:00)
Title: Logger available in modules

This simple module throws an error when it reach the ```virgilio.log.info`` function.

```js
var myModule = function (options) {
var virgilio = this;

virgilio.namespace('myModule')
.defineAction('doge', doge);

function doge() {
if (options.myModuleOptions.myCustomOption) {
virgilio.log.info('myModule.doge called');
return 'such action';
}
}
};

var virgilio = require('virgilio')(options);

virgilio.loadModule(myModule);

virgilio.execute('myModule.doge')
.then(function (result) {
console.log(result);
})
.done();
```

We can solve this simple exposing the 'log' function in the root namespace.