瀏覽代碼

Remove notebook output logging.

Notebook output logging made it easier to test the logging console extension. I think it is too much noise for production, though, unless it is behind a option and turned off by default. See https://github.com/jupyterlab/jupyterlab/issues/7386
Jason Grout 5 年之前
父節點
當前提交
0d4115df31

+ 0 - 1
packages/logconsole-extension/package.json

@@ -40,7 +40,6 @@
     "@jupyterlab/mainmenu": "^2.0.0-alpha.1",
     "@jupyterlab/notebook": "^2.0.0-alpha.1",
     "@jupyterlab/rendermime": "^2.0.0-alpha.1",
-    "@jupyterlab/services": "^5.0.0-alpha.1",
     "@jupyterlab/statusbar": "^2.0.0-alpha.1",
     "@jupyterlab/ui-components": "^2.0.0-alpha.1",
     "@phosphor/signaling": "^1.3.0",

+ 1 - 3
packages/logconsole-extension/src/index.tsx

@@ -274,6 +274,4 @@ function activateLogConsole(
   return loggerRegistry;
 }
 
-// TODO: delete the nboutput widget, or at least make it a non-default option?
-import { logNotebookOutput } from './nboutput';
-export default [logConsolePlugin, logNotebookOutput];
+export default [logConsolePlugin];

+ 0 - 54
packages/logconsole-extension/src/nboutput.ts

@@ -1,54 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  JupyterFrontEnd,
-  JupyterFrontEndPlugin
-} from '@jupyterlab/application';
-
-import { nbformat } from '@jupyterlab/coreutils';
-
-import { ILoggerRegistry } from '@jupyterlab/logconsole';
-
-import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
-
-import { KernelMessage } from '@jupyterlab/services';
-
-/**
- * The Log Console extension.
- */
-export const logNotebookOutput: JupyterFrontEndPlugin<void> = {
-  activate: activateNBOutput,
-  id: 'logconsole:nboutput',
-  requires: [ILoggerRegistry, INotebookTracker],
-  autoStart: true
-};
-
-function activateNBOutput(
-  app: JupyterFrontEnd,
-  loggerRegistry: ILoggerRegistry,
-  nbtracker: INotebookTracker
-) {
-  function registerNB(nb: NotebookPanel) {
-    nb.context.session.iopubMessage.connect(
-      (_, msg: KernelMessage.IIOPubMessage) => {
-        if (
-          KernelMessage.isDisplayDataMsg(msg) ||
-          KernelMessage.isStreamMsg(msg) ||
-          KernelMessage.isErrorMsg(msg) ||
-          KernelMessage.isExecuteResultMsg(msg)
-        ) {
-          const logger = loggerRegistry.getLogger(nb.context.path);
-          logger.rendermime = nb.content.rendermime;
-          const data: nbformat.IOutput = {
-            ...msg.content,
-            output_type: msg.header.msg_type
-          };
-          logger.log({ type: 'output', data });
-        }
-      }
-    );
-  }
-  nbtracker.forEach(nb => registerNB(nb));
-  nbtracker.widgetAdded.connect((_, nb) => registerNB(nb));
-}

+ 0 - 3
packages/logconsole-extension/tsconfig.json

@@ -27,9 +27,6 @@
     {
       "path": "../rendermime"
     },
-    {
-      "path": "../services"
-    },
     {
       "path": "../statusbar"
     },