Removed --console-log and superset runserver (#7421)

This commit is contained in:
Russell Jurney 2019-05-01 20:46:39 -07:00 committed by Maxime Beauchemin
parent a6aabf8268
commit 70be44afe1
4 changed files with 0 additions and 110 deletions

View File

@ -326,22 +326,6 @@ cd superset
FLASK_ENV=development flask run -p 8088 --with-threads --reload --debugger
```
#### Logging to the browser console
This feature is only available on Python 3. When debugging your application, you can have the server logs sent directly to the browser console:
```bash
FLASK_ENV=development flask run -p 8088 --with-threads --reload --debugger --console-log
```
You can log anything to the browser console, including objects:
```python
from superset import app
app.logger.error('An exception occurred!')
app.logger.info(form_data)
```
### Frontend Assets
Frontend assets (JavaScript, CSS, and images) must be compiled in order to properly display the web UI. The `superset/assets` directory contains all NPM-managed front end assets. Note that there are additional frontend assets bundled with Flask-Appbuilder (e.g. jQuery and bootstrap); these are not managed by NPM, and may be phased out in the future.

View File

@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
console_log==0.2.10
coverage==4.5.3
flake8-commas==2.0.0
flake8-import-order==0.18

View File

@ -108,7 +108,6 @@ setup(
],
extras_require={
'cors': ['flask-cors>=2.0.0'],
'console_log': ['console_log==0.2.10'],
'hive': [
'pyhive[hive]>=0.6.1',
'tableschema',

View File

@ -24,7 +24,6 @@ from sys import stdout
import click
from colorama import Fore, Style
from pathlib2 import Path
import werkzeug.serving
import yaml
from superset import (
@ -54,97 +53,6 @@ def init():
security_manager.sync_role_definitions()
def debug_run(app, port, use_reloader):
click.secho(
'[DEPRECATED] As of Flask >=1.0.0, this command is no longer '
'supported, please use `flask run` instead, as documented in our '
'CONTRIBUTING.md',
fg='red',
)
click.secho('[example]', fg='yellow')
click.secho(
'flask run -p 8080 --with-threads --reload --debugger',
fg='green',
)
def console_log_run(app, port, use_reloader):
from console_log import ConsoleLog
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
app.wsgi_app = ConsoleLog(app.wsgi_app, app.logger)
def run():
server = pywsgi.WSGIServer(
('0.0.0.0', int(port)),
app,
handler_class=WebSocketHandler)
server.serve_forever()
if use_reloader:
from gevent import monkey
monkey.patch_all()
run = werkzeug.serving.run_with_reloader(run)
run()
@app.cli.command()
@click.option('--debug', '-d', is_flag=True, help='Start the web server in debug mode')
@click.option('--console-log', is_flag=True,
help='Create logger that logs to the browser console (implies -d)')
@click.option('--no-reload', '-n', 'use_reloader', flag_value=False,
default=config.get('FLASK_USE_RELOAD'),
help='Don\'t use the reloader in debug mode')
@click.option('--address', '-a', default=config.get('SUPERSET_WEBSERVER_ADDRESS'),
help='Specify the address to which to bind the web server')
@click.option('--port', '-p', default=config.get('SUPERSET_WEBSERVER_PORT'),
help='Specify the port on which to run the web server')
@click.option('--workers', '-w', default=config.get('SUPERSET_WORKERS', 2),
help='Number of gunicorn web server workers to fire up [DEPRECATED]')
@click.option('--timeout', '-t', default=config.get('SUPERSET_WEBSERVER_TIMEOUT'),
help='Specify the timeout (seconds) for the '
'gunicorn web server [DEPRECATED]')
@click.option('--socket', '-s', default=config.get('SUPERSET_WEBSERVER_SOCKET'),
help='Path to a UNIX socket as an alternative to address:port, e.g. '
'/var/run/superset.sock. '
'Will override the address and port values. [DEPRECATED]')
def runserver(debug, console_log, use_reloader, address, port, timeout, workers, socket):
"""Starts a Superset web server."""
debug = debug or config.get('DEBUG') or console_log
if debug:
print(Fore.BLUE + '-=' * 20)
print(
Fore.YELLOW + 'Starting Superset server in ' +
Fore.RED + 'DEBUG' +
Fore.YELLOW + ' mode')
print(Fore.BLUE + '-=' * 20)
print(Style.RESET_ALL)
if console_log:
console_log_run(app, port, use_reloader)
else:
debug_run(app, port, use_reloader)
else:
logging.info(
"The Gunicorn 'superset runserver' command is deprecated. Please "
"use the 'gunicorn' command instead.")
addr_str = f' unix:{socket} ' if socket else f' {address}:{port} '
cmd = (
'gunicorn '
f'-w {workers} '
f'--timeout {timeout} '
f'-b {addr_str} '
'--limit-request-line 0 '
'--limit-request-field_size 0 '
'superset:app'
)
print(Fore.GREEN + 'Starting server with command: ')
print(Fore.YELLOW + cmd)
print(Style.RESET_ALL)
Popen(cmd, shell=True).wait()
@app.cli.command()
@click.option('--verbose', '-v', is_flag=True, help='Show extra information')
def version(verbose):