mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
Improve logging
This commit is contained in:
+2
-2
@@ -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
@@ -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!');
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user