mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-11 03:52:59 +00:00
use loglevel for js logging
because javascript is the best!
This commit is contained in:
13
lib/main.js
13
lib/main.js
@@ -3,11 +3,12 @@
|
||||
cli entrypoint for starting a Configurable Proxy
|
||||
|
||||
*/
|
||||
var fs = require('fs');
|
||||
var args = require('commander');
|
||||
var fs = require('fs'),
|
||||
args = require('commander'),
|
||||
log = require('loglevel');
|
||||
|
||||
args
|
||||
.version('0.0.0')
|
||||
.version('0.0.1')
|
||||
// .option('-h', '--help', 'show help')
|
||||
.option('--key <keyfile>', 'SSL key to use, if any')
|
||||
.option('--cert <certfile>', 'SSL certificate to use, if any')
|
||||
@@ -17,8 +18,10 @@ args
|
||||
.option('--upstream-port <n>', 'Port of the default proxy target', parseInt)
|
||||
.option('--api-ip <ip>', 'Inward-facing IP for API request', 'localhost')
|
||||
.option('--api-port <n>', 'Inward-facing port for API request', parseInt)
|
||||
.option('--log-level <loglevel>', 'Log level (debug, info, warn, error)', 'info');
|
||||
|
||||
args.parse(process.argv);
|
||||
log.setLevel(args.logLevel);
|
||||
|
||||
var ConfigurableProxy = require('./configproxy.js').ConfigurableProxy;
|
||||
|
||||
@@ -47,8 +50,8 @@ listen.api_port = args.apiPort || listen.port + 1;
|
||||
proxy.proxy_server.listen(listen.port, listen.ip);
|
||||
proxy.api_server.listen(listen.api_port, listen.api_ip);
|
||||
|
||||
console.log("Proxying %s:%s to %s:%s", (listen.ip || '*'), listen.port,
|
||||
log.info("Proxying %s:%s to %s:%s", (listen.ip || '*'), listen.port,
|
||||
proxy.upstream_ip, proxy.upstream_port
|
||||
);
|
||||
console.log("Proxy API at %s:%s/api/routes", (listen.api_ip || '*'), listen.api_port);
|
||||
log.info("Proxy API at %s:%s/api/routes", (listen.api_ip || '*'), listen.api_port);
|
||||
|
||||
|
Reference in New Issue
Block a user