Skip to content

Commit 7df7f6f

Browse files
authored
Merge pull request #1126 from solid/extract-print-debug
Extract printing debug info from ldp to config module
2 parents 217e8e3 + 35839d5 commit 7df7f6f

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

lib/create-app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ function createApp (argv = {}) {
5454
const configPath = config.initConfigDir(argv)
5555
argv.templates = config.initTemplateDirs(configPath)
5656

57+
config.printDebugInfo(argv)
58+
5759
const ldp = new LDP(argv)
5860

5961
const app = express()

lib/ldp.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@ class LDP {
6363
this.corsProxy = '/' + this.corsProxy
6464
}
6565

66-
debug.settings('Server URI: ' + this.serverUri)
67-
debug.settings('Auth method: ' + this.auth)
68-
debug.settings('Strict origins: ' + this.strictOrigin)
69-
debug.settings('Allowed origins: ' + this.trustedOrigins)
70-
debug.settings('Db path: ' + this.dbPath)
71-
debug.settings('Config path: ' + this.configPath)
72-
debug.settings('Suffix Acl: ' + this.suffixAcl)
73-
debug.settings('Suffix Meta: ' + this.suffixMeta)
74-
debug.settings('Filesystem Root: ' + (this.resourceMapper ? this.resourceMapper.rootPath : 'none'))
75-
debug.settings('Allow WebID authentication: ' + !!this.webid)
76-
debug.settings('Live-updates: ' + !!this.live)
77-
debug.settings('Multi-user: ' + !!this.multiuser)
78-
debug.settings('Suppress default data browser app: ' + this.suppressDataBrowser)
79-
debug.settings('Default data browser app file path: ' + this.dataBrowserPath)
80-
8166
return this
8267
}
8368

lib/server-config.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ const path = require('path')
99
const templateUtils = require('./common/template-utils')
1010
const fsUtils = require('./common/fs-utils')
1111

12+
const debug = require('./debug')
13+
14+
function printDebugInfo (options) {
15+
debug.settings('Server URI: ' + options.serverUri)
16+
debug.settings('Auth method: ' + options.auth)
17+
debug.settings('Strict origins: ' + options.strictOrigin)
18+
debug.settings('Allowed origins: ' + options.trustedOrigins)
19+
debug.settings('Db path: ' + options.dbPath)
20+
debug.settings('Config path: ' + options.configPath)
21+
debug.settings('Suffix Acl: ' + options.suffixAcl)
22+
debug.settings('Suffix Meta: ' + options.suffixMeta)
23+
debug.settings('Filesystem Root: ' + (this.resourceMapper ? this.resourceMapper.rootPath : 'none'))
24+
debug.settings('Allow WebID authentication: ' + !!options.webid)
25+
debug.settings('Live-updates: ' + !!options.live)
26+
debug.settings('Multi-user: ' + !!options.multiuser)
27+
debug.settings('Suppress default data browser app: ' + options.suppressDataBrowser)
28+
debug.settings('Default data browser app file path: ' + options.dataBrowserPath)
29+
}
30+
1231
/**
1332
* Ensures that a directory has been copied / initialized. Used to ensure that
1433
* account templates, email templates and default apps have been copied from
@@ -144,5 +163,6 @@ module.exports = {
144163
ensureWelcomePage,
145164
initConfigDir,
146165
initDefaultViews,
147-
initTemplateDirs
166+
initTemplateDirs,
167+
printDebugInfo
148168
}

0 commit comments

Comments
 (0)