Improve logging

This commit is contained in:
Samy Pessé
2016-02-24 17:12:38 +01:00
parent 1fa952b930
commit 86e4a935e2
3 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -30,14 +30,14 @@ function Config(book, baseConfig) {
Config.prototype.load = function() {
var that = this;
this.log.info.ln('loading configuration');
// Try all potential configuration file
return Promise.some(CONFIG_FILES, function(filename) {
that.log.debug.ln('try loading configuration from', filename);
return that.fs.loadAsObject(that.book.resolve(filename))
.then(function(_config) {
that.log.debug.ln('configuration loaded from', filename);
that.path = filename;
return that.replace(_config);
})
+5 -1
View File
@@ -61,7 +61,7 @@ Output.prototype.generate = function() {
// Initialize the generation
.then(function() {
that.log.debug.ln('preparing the generation');
that.log.info.ln('preparing the generation');
return that.prepare();
})
@@ -106,6 +106,9 @@ Output.prototype.generate = function() {
if (!that.book.isMultilingual()) return;
return Promise.serie(that.book.books, function(subbook) {
that.log.info.ln('');
that.log.info.ln('start generation of language "' + path.relative(that.book.root, subbook.root) + '"');
var out = that.onLanguageBook(subbook);
return out.generate();
});
@@ -118,6 +121,7 @@ Output.prototype.generate = function() {
})
.then(function() {
if (!that.book.isLanguageBook()) that.log.info.ln('');
that.log.info.ln('generation finished with success!');
});
};
+1 -1
View File
@@ -113,7 +113,7 @@ BookPlugin.prototype.load = function(folder) {
that.book.config.set(that.getConfigKey(), config);
});
this.log.info('Loading plugin "' + this.id + '" ...');
this.log.info('loading plugin "' + this.id + '" ...');
return this.log.info.promise(p);
};