Forráskód Böngészése

refactor & rename

Mehmet Bektas 5 éve
szülő
commit
5c9c2466d9

+ 92 - 88
packages/outputconsole-extension/src/index.tsx

@@ -18,12 +18,12 @@ import {
 import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
 
 import {
-  IOutputLogRegistry,
-  OutputLoggerView,
-  OutputLogRegistry,
+  ILoggerRegistry,
+  LoggerRegistry,
+  LogConsolePanel,
   ILogger,
   ILoggerChange,
-  ILogRegistryChange
+  ILoggerRegistryChange
 } from '@jupyterlab/outputconsole';
 
 import { KernelMessage } from '@jupyterlab/services';
@@ -48,15 +48,15 @@ import {
 
 import { ISettingRegistry } from '@jupyterlab/coreutils';
 
-const OUTPUT_CONSOLE_PLUGIN_ID = '@jupyterlab/outputconsole-extension:plugin';
+const LOG_CONSOLE_PLUGIN_ID = '@jupyterlab/logconsole-extension:plugin';
 
 /**
  * The Output Log extension.
  */
-const outputLogPlugin: JupyterFrontEndPlugin<IOutputLogRegistry> = {
-  activate: activateOutputLog,
-  id: OUTPUT_CONSOLE_PLUGIN_ID,
-  provides: IOutputLogRegistry,
+const logConsolePlugin: JupyterFrontEndPlugin<ILoggerRegistry> = {
+  activate: activateLogConsole,
+  id: LOG_CONSOLE_PLUGIN_ID,
+  provides: ILoggerRegistry,
   requires: [
     IMainMenu,
     ICommandPalette,
@@ -71,7 +71,7 @@ const outputLogPlugin: JupyterFrontEndPlugin<IOutputLogRegistry> = {
 /*
  * A namespace for OutputStatusComponent.
  */
-namespace OutputStatusComponent {
+namespace LogConsoleStatusComponent {
   /**
    * The props for the OutputStatusComponent.
    */
@@ -96,14 +96,14 @@ namespace OutputStatusComponent {
  *
  * @returns a tsx component for rendering the Output Console logs.
  */
-function OutputStatusComponent(
-  props: OutputStatusComponent.IProps
-): React.ReactElement<OutputStatusComponent.IProps> {
+function LogConsoleStatusComponent(
+  props: LogConsoleStatusComponent.IProps
+): React.ReactElement<LogConsoleStatusComponent.IProps> {
   return (
     <GroupItem
       spacing={0}
       onClick={props.handleClick}
-      title={`${props.logCount} messages in Output Console`}
+      title={`${props.logCount} logs in Log Console`}
     >
       <IconItem
         source={'jp-StatusItem-output-console lab-output-console-icon'}
@@ -116,14 +116,14 @@ function OutputStatusComponent(
 /**
  * A VDomRenderer widget for displaying the status of Output Console logs.
  */
-export class OutputStatus extends VDomRenderer<OutputStatus.Model> {
+export class LogConsoleStatus extends VDomRenderer<LogConsoleStatus.Model> {
   /**
    * Construct the output console status widget.
    */
-  constructor(opts: OutputStatus.IOptions) {
+  constructor(opts: LogConsoleStatus.IOptions) {
     super();
     this._handleClick = opts.handleClick;
-    this.model = new OutputStatus.Model(opts.outputLogRegistry);
+    this.model = new LogConsoleStatus.Model(opts.loggerRegistry);
     this.addClass(interactiveItem);
     this.addClass('outputconsole-status-item');
 
@@ -139,7 +139,7 @@ export class OutputStatus extends VDomRenderer<OutputStatus.Model> {
       if (this.model.activeSourceChanged) {
         if (
           !this.model.activeSource ||
-          this.model.isSourceOutputRead(this.model.activeSource)
+          this.model.isSourceLogsRead(this.model.activeSource)
         ) {
           this._clearHighlight();
         } else {
@@ -173,7 +173,7 @@ export class OutputStatus extends VDomRenderer<OutputStatus.Model> {
       return null;
     } else {
       return (
-        <OutputStatusComponent
+        <LogConsoleStatusComponent
           handleClick={this._handleClick}
           logCount={this.model.logCount}
         />
@@ -200,7 +200,7 @@ export class OutputStatus extends VDomRenderer<OutputStatus.Model> {
 /**
  * A namespace for Output Console log status.
  */
-export namespace OutputStatus {
+export namespace LogConsoleStatus {
   /**
    * A VDomModel for the OutputStatus item.
    */
@@ -208,14 +208,14 @@ export namespace OutputStatus {
     /**
      * Create a new OutputStatus model.
      */
-    constructor(outputLogRegistry: IOutputLogRegistry) {
+    constructor(loggerRegistry: ILoggerRegistry) {
       super();
 
-      this._outputLogRegistry = outputLogRegistry;
+      this._loggerRegistry = loggerRegistry;
 
-      this._outputLogRegistry.registryChanged.connect(
-        (sender: IOutputLogRegistry, args: ILogRegistryChange) => {
-          const loggers = this._outputLogRegistry.getLoggers();
+      this._loggerRegistry.registryChanged.connect(
+        (sender: ILoggerRegistry, args: ILoggerRegistryChange) => {
+          const loggers = this._loggerRegistry.getLoggers();
           for (let logger of loggers) {
             if (this._loggersWatched.has(logger.source)) {
               continue;
@@ -241,7 +241,7 @@ export namespace OutputStatus {
 
     get logCount(): number {
       if (this._activeSource) {
-        const logger = this._outputLogRegistry.getLogger(this._activeSource);
+        const logger = this._loggerRegistry.getLogger(this._activeSource);
         return Math.min(logger.length, this._messageLimit);
       }
 
@@ -263,7 +263,7 @@ export namespace OutputStatus {
     /**
      * Sets message entry limit.
      */
-    set messageLimit(limit: number) {
+    set entryLimit(limit: number) {
       if (limit > 0) {
         this._messageLimit = limit;
 
@@ -272,11 +272,11 @@ export namespace OutputStatus {
       }
     }
 
-    markSourceOutputRead(name: string) {
+    markSourceLogsRead(name: string) {
       this._loggersWatched.set(name, true);
     }
 
-    isSourceOutputRead(name: string): boolean {
+    isSourceLogsRead(name: string): boolean {
       return (
         !this._loggersWatched.has(name) ||
         this._loggersWatched.get(name) === true
@@ -285,7 +285,7 @@ export namespace OutputStatus {
 
     public highlightingEnabled: boolean = true;
     public activeSourceChanged: boolean = false;
-    private _outputLogRegistry: IOutputLogRegistry;
+    private _loggerRegistry: ILoggerRegistry;
     private _activeSource: string = null;
     private _messageLimit: number = 1000;
     private _loggersWatched: Map<string, boolean> = new Map();
@@ -299,7 +299,7 @@ export namespace OutputStatus {
      * Output Console widget which provides
      * Output Console interface and access to log info
      */
-    outputLogRegistry: IOutputLogRegistry;
+    loggerRegistry: ILoggerRegistry;
 
     /**
      * A click handler for the item. By default
@@ -312,7 +312,7 @@ export namespace OutputStatus {
 /**
  * Activate the Output Log extension.
  */
-function activateOutputLog(
+function activateLogConsole(
   app: JupyterFrontEnd,
   mainMenu: IMainMenu,
   palette: ICommandPalette,
@@ -321,17 +321,17 @@ function activateOutputLog(
   rendermime: IRenderMimeRegistry,
   restorer: ILayoutRestorer | null,
   settingRegistry: ISettingRegistry | null
-): IOutputLogRegistry {
-  let loggerWidget: MainAreaWidget<OutputLoggerView> = null;
-  let messageLimit: number = 1000;
+): ILoggerRegistry {
+  let logConsoleWidget: MainAreaWidget<LogConsolePanel> = null;
+  let entryLimit: number = 1000;
   let highlightingEnabled: boolean = true;
 
-  const logRegistry = new OutputLogRegistry(rendermime);
-  const command = 'outputconsole:open';
+  const loggerRegistry = new LoggerRegistry(rendermime);
+  const command = 'logconsole:open';
   const category: string = 'Main Area';
 
-  let tracker = new WidgetTracker<MainAreaWidget<OutputLoggerView>>({
-    namespace: 'outputlogger'
+  const tracker = new WidgetTracker<MainAreaWidget<LogConsolePanel>>({
+    namespace: 'logconsole'
   });
 
   if (restorer) {
@@ -341,61 +341,61 @@ function activateOutputLog(
         fromRestorer: true,
         activeSource: obj.content.activeSource
       }),
-      name: () => 'outputLogger'
+      name: () => 'logconsole'
     });
   }
 
-  const status = new OutputStatus({
-    outputLogRegistry: logRegistry,
+  const status = new LogConsoleStatus({
+    loggerRegistry: loggerRegistry,
     handleClick: () => {
-      if (!loggerWidget) {
-        createLoggerWidget();
+      if (!logConsoleWidget) {
+        createLogConsoleWidget();
       } else {
-        loggerWidget.activate();
+        logConsoleWidget.activate();
       }
 
       // TODO, repeat in command?
-      status.model.messageLimit = messageLimit;
-      status.model.markSourceOutputRead(status.model.activeSource);
+      status.model.entryLimit = entryLimit;
+      status.model.markSourceLogsRead(status.model.activeSource);
       status.model.highlightingEnabled = false;
       status.model.stateChanged.emit(void 0);
     }
   });
 
-  const createLoggerWidget = () => {
+  const createLogConsoleWidget = () => {
     let activeSource: string = nbtracker.currentWidget
       ? nbtracker.currentWidget.context.path
       : null;
 
-    const loggerView = new OutputLoggerView(logRegistry);
-    loggerWidget = new MainAreaWidget({ content: loggerView });
-    loggerWidget.addClass('lab-output-console');
-    loggerWidget.title.closable = true;
-    loggerWidget.title.label = 'Output Console';
-    loggerWidget.title.iconClass = 'lab-output-console-icon';
-    loggerView.messageLimit = messageLimit;
+    const logConsolePanel = new LogConsolePanel(loggerRegistry);
+    logConsoleWidget = new MainAreaWidget({ content: logConsolePanel });
+    logConsoleWidget.addClass('lab-output-console');
+    logConsoleWidget.title.closable = true;
+    logConsoleWidget.title.label = 'Log Console';
+    logConsoleWidget.title.iconClass = 'lab-output-console-icon';
+    logConsolePanel.entryLimit = entryLimit;
 
-    app.shell.add(loggerWidget, 'main', {
+    app.shell.add(logConsoleWidget, 'main', {
       ref: '',
       mode: 'split-bottom'
     });
 
-    loggerWidget.update();
+    logConsoleWidget.update();
 
-    app.shell.activateById(loggerWidget.id);
+    app.shell.activateById(logConsoleWidget.id);
     status.model.highlightingEnabled = false;
 
     if (activeSource) {
-      loggerView.activeSource = activeSource;
+      logConsolePanel.activeSource = activeSource;
     }
 
     const addTimestampButton = new ToolbarButton({
       onClick: (): void => {
-        if (!loggerView.activeSource) {
+        if (!logConsolePanel.activeSource) {
           return;
         }
 
-        const logger = logRegistry.getLogger(loggerView.activeSource);
+        const logger = loggerRegistry.getLogger(logConsolePanel.activeSource);
         logger.log({
           data: {
             'text/html': '<hr>'
@@ -410,7 +410,7 @@ function activateOutputLog(
 
     const clearButton = new ToolbarButton({
       onClick: (): void => {
-        const logger = logRegistry.getLogger(loggerView.activeSource);
+        const logger = loggerRegistry.getLogger(logConsolePanel.activeSource);
         logger.clear();
       },
       iconClassName: 'fa fa-ban clear-icon',
@@ -418,16 +418,16 @@ function activateOutputLog(
       label: 'Clear Logs'
     });
 
-    loggerWidget.toolbar.addItem(
+    logConsoleWidget.toolbar.addItem(
       'lab-output-console-add-timestamp',
       addTimestampButton
     );
-    loggerWidget.toolbar.addItem('lab-output-console-clear', clearButton);
+    logConsoleWidget.toolbar.addItem('lab-output-console-clear', clearButton);
 
-    void tracker.add(loggerWidget);
+    void tracker.add(logConsoleWidget);
 
-    loggerWidget.disposed.connect(() => {
-      loggerWidget = null;
+    logConsoleWidget.disposed.connect(() => {
+      logConsoleWidget = null;
       status.model.highlightingEnabled = highlightingEnabled;
     });
   };
@@ -435,18 +435,18 @@ function activateOutputLog(
   app.commands.addCommand(command, {
     label: 'Show Log Console',
     execute: (args: any) => {
-      if (!loggerWidget) {
-        createLoggerWidget();
+      if (!logConsoleWidget) {
+        createLogConsoleWidget();
 
         if (args && args.activeSource) {
-          loggerWidget.content.activeSource = args.activeSource;
+          logConsoleWidget.content.activeSource = args.activeSource;
         }
       } else if (!(args && args.fromRestorer)) {
-        loggerWidget.dispose();
+        logConsoleWidget.dispose();
       }
     },
     isToggled: () => {
-      return loggerWidget !== null;
+      return logConsoleWidget !== null;
     }
   });
 
@@ -463,7 +463,7 @@ function activateOutputLog(
     appRestored = true;
   });
 
-  statusBar.registerStatusItem('@jupyterlab/outputconsole-extension:status', {
+  statusBar.registerStatusItem('@jupyterlab/logconsole-extension:status', {
     item: status,
     align: 'left',
     isActive: () => true,
@@ -480,7 +480,7 @@ function activateOutputLog(
             KernelMessage.isStreamMsg(msg) ||
             KernelMessage.isErrorMsg(msg)
           ) {
-            const logger = logRegistry.getLogger(nb.context.path);
+            const logger = loggerRegistry.getLogger(nb.context.path);
             logger.rendermime = nb.content.rendermime;
             const output: nbformat.IOutput = {
               ...msg.content,
@@ -500,18 +500,21 @@ function activateOutputLog(
         }
 
         const sourceName = nb.context.path;
-        if (loggerWidget) {
-          loggerWidget.content.activeSource = sourceName;
-          void tracker.save(loggerWidget);
+        if (logConsoleWidget) {
+          logConsoleWidget.content.activeSource = sourceName;
+          void tracker.save(logConsoleWidget);
         }
         status.model.activeSource = sourceName;
       });
 
       nb.disposed.connect((nb: NotebookPanel, args: void) => {
         const sourceName = nb.context.path;
-        if (loggerWidget && loggerWidget.content.activeSource === sourceName) {
-          loggerWidget.content.activeSource = null;
-          void tracker.save(loggerWidget);
+        if (
+          logConsoleWidget &&
+          logConsoleWidget.content.activeSource === sourceName
+        ) {
+          logConsoleWidget.content.activeSource = null;
+          void tracker.save(logConsoleWidget);
         }
         if (status.model.activeSource === sourceName) {
           status.model.activeSource = null;
@@ -523,18 +526,19 @@ function activateOutputLog(
   if (settingRegistry) {
     const updateSettings = (settings: ISettingRegistry.ISettings): void => {
       const maxLogEntries = settings.get('maxLogEntries').composite as number;
-      messageLimit = maxLogEntries;
+      entryLimit = maxLogEntries;
 
-      if (loggerWidget) {
-        loggerWidget.content.messageLimit = messageLimit;
+      if (logConsoleWidget) {
+        logConsoleWidget.content.entryLimit = entryLimit;
       }
-      status.model.messageLimit = messageLimit;
+      status.model.entryLimit = entryLimit;
 
       highlightingEnabled = settings.get('flash').composite as boolean;
-      status.model.highlightingEnabled = !loggerWidget && highlightingEnabled;
+      status.model.highlightingEnabled =
+        !logConsoleWidget && highlightingEnabled;
     };
 
-    Promise.all([settingRegistry.load(OUTPUT_CONSOLE_PLUGIN_ID), app.restored])
+    Promise.all([settingRegistry.load(LOG_CONSOLE_PLUGIN_ID), app.restored])
       .then(([settings]) => {
         updateSettings(settings);
         settings.changed.connect(settings => {
@@ -546,9 +550,9 @@ function activateOutputLog(
       });
   }
 
-  return logRegistry;
+  return loggerRegistry;
   // The notebook can call this command.
   // When is the output model disposed?
 }
 
-export default [outputLogPlugin];
+export default [logConsolePlugin];

+ 141 - 140
packages/outputconsole/src/index.tsx

@@ -29,25 +29,27 @@ import { Message } from '@phosphor/messaging';
 /**
  * The Output Log Registry token.
  */
-export const IOutputLogRegistry = new Token<IOutputLogRegistry>(
-  '@jupyterlab/outputconsole:IOutputLogRegistry'
+export const ILoggerRegistry = new Token<ILoggerRegistry>(
+  '@jupyterlab/logconsole:ILoggerRegistry'
 );
 
-export interface IOutputLogRegistry {
-  getLogger(name: string): ILogger;
+export interface ILoggerRegistry {
+  getLogger(source: string): ILogger;
   getLoggers(): ILogger[];
 
   /**
    * A signal emitted when the log registry changes.
    */
-  readonly registryChanged: ISignal<this, ILogRegistryChange>;
+  readonly registryChanged: ISignal<this, ILoggerRegistryChange>;
 }
 
-export interface IOutputWithTimestamp extends nbformat.IBaseOutput {
+export interface ITimestampedOutput extends nbformat.IBaseOutput {
   timestamp: number;
 }
 
-type IOutputWithTimestampType = nbformat.IOutput | IOutputWithTimestamp;
+type IOutputWithTimestamp = nbformat.IOutput | ITimestampedOutput;
+
+export type ILoggerChange = 'append' | 'clear';
 
 export interface ILogger {
   log(log: nbformat.IOutput): void;
@@ -66,6 +68,34 @@ export interface ILogger {
   readonly outputAreaModel: LoggerOutputAreaModel;
 }
 
+export class LogOutputModel extends OutputModel {
+  constructor(options: LogOutputModel.IOptions) {
+    super(options);
+
+    this.timestamp = new Date(options.value.timestamp as number);
+  }
+
+  timestamp: Date = null;
+}
+
+export namespace LogOutputModel {
+  export interface IOptions extends IOutputModel.IOptions {
+    value: IOutputWithTimestamp;
+  }
+}
+
+/**
+ * The default implementation of `IContentFactory`.
+ */
+export class LogConsoleModelContentFactory extends OutputAreaModel.ContentFactory {
+  /**
+   * Create an output model.
+   */
+  createOutputModel(options: IOutputModel.IOptions): LogOutputModel {
+    return new LogOutputModel(options);
+  }
+}
+
 export class Logger implements ILogger {
   constructor(source: string) {
     this.source = source;
@@ -83,7 +113,7 @@ export class Logger implements ILogger {
   }
 
   /**
-   * A signal emitted when the log model changes.
+   * A signal emitted when the rendermime changes.
    */
   get rendermimeChanged(): ISignal<this, void> {
     return this._rendermimeChanged;
@@ -111,34 +141,32 @@ export class Logger implements ILogger {
     return this._rendermime;
   }
 
-  private _logChanged = new Signal<this, ILoggerChange>(this);
-  private _rendermimeChanged = new Signal<this, void>(this);
   readonly source: string;
   readonly outputAreaModel = new LoggerOutputAreaModel({
-    contentFactory: new LoggerModelFactory()
+    contentFactory: new LogConsoleModelContentFactory()
   });
-
-  _rendermime: IRenderMimeRegistry | null = null;
+  private _logChanged = new Signal<this, ILoggerChange>(this);
+  private _rendermimeChanged = new Signal<this, void>(this);
+  private _rendermime: IRenderMimeRegistry | null = null;
 }
 
-export type ILogRegistryChange = 'append' | 'remove';
-export type ILoggerChange = 'append' | 'clear';
+export type ILoggerRegistryChange = 'append';
 
-export class OutputLogRegistry implements IOutputLogRegistry {
+export class LoggerRegistry implements ILoggerRegistry {
   constructor(defaultRendermime: IRenderMimeRegistry) {
     this._defaultRendermime = defaultRendermime;
   }
 
-  getLogger(name: string): ILogger {
+  getLogger(source: string): ILogger {
     const loggers = this._loggers;
-    let logger = loggers.get(name);
+    let logger = loggers.get(source);
     if (logger) {
       return logger;
     }
 
-    logger = new Logger(name);
+    logger = new Logger(source);
     logger.rendermime = this._defaultRendermime;
-    loggers.set(name, logger);
+    loggers.set(source, logger);
 
     this._registryChanged.emit('append');
 
@@ -152,16 +180,39 @@ export class OutputLogRegistry implements IOutputLogRegistry {
   /**
    * A signal emitted when the log registry changes.
    */
-  get registryChanged(): ISignal<this, ILogRegistryChange> {
+  get registryChanged(): ISignal<this, ILoggerRegistryChange> {
     return this._registryChanged;
   }
 
   private _loggers = new Map<string, Logger>();
-  private _registryChanged = new Signal<this, ILogRegistryChange>(this);
+  private _registryChanged = new Signal<this, ILoggerRegistryChange>(this);
   private _defaultRendermime: IRenderMimeRegistry = null;
 }
 
-export class LoggerOutputArea extends OutputArea {
+/**
+ * The default output prompt implementation
+ */
+class LogConsoleOutputPrompt extends Widget implements IOutputPrompt {
+  constructor() {
+    super();
+
+    this._timestampNode = document.createElement('div');
+    this.node.append(this._timestampNode);
+  }
+
+  set timestamp(value: Date) {
+    this._timestampNode.innerHTML = value.toLocaleTimeString();
+  }
+
+  /**
+   * The execution count for the prompt.
+   */
+  executionCount: nbformat.ExecutionCount;
+
+  private _timestampNode: HTMLDivElement;
+}
+
+export class LogConsoleOutputArea extends OutputArea {
   /**
    * Handle an input request from a kernel by doing nothing.
    */
@@ -175,9 +226,10 @@ export class LoggerOutputArea extends OutputArea {
   /**
    * Create an output item with a prompt and actual output
    */
-  protected createOutputItem(model: LoggerOutputModel): Widget | null {
+  protected createOutputItem(model: LogOutputModel): Widget | null {
     const panel = super.createOutputItem(model) as Panel;
-    (panel.widgets[0] as LoggerOutputPrompt).timestamp = model.timestamp;
+    // first widget in panel is prompt of type LoggerOutputPrompt
+    (panel.widgets[0] as LogConsoleOutputPrompt).timestamp = model.timestamp;
     return panel;
   }
 
@@ -185,7 +237,6 @@ export class LoggerOutputArea extends OutputArea {
    * The rendermime instance used by the widget.
    */
   rendermime: IRenderMimeRegistry;
-
   readonly model: LoggerOutputAreaModel;
 }
 
@@ -194,66 +245,50 @@ export class LoggerOutputAreaModel extends OutputAreaModel {
     super(options);
   }
 
-  set messageLimit(limit: number) {
-    this._messageLimit = limit;
+  set entryLimit(limit: number) {
+    this._entryLimit = limit;
     this.applyLimit();
   }
 
   applyLimit() {
-    if (this.list.length > this._messageLimit) {
-      const diff = this.list.length - this._messageLimit;
+    if (this.list.length > this._entryLimit) {
+      const diff = this.list.length - this._entryLimit;
       this.list.removeRange(0, diff);
       this.trusted = false;
     }
   }
 
-  private _messageLimit: number = 1000;
-}
-
-export class LoggerOutputModel extends OutputModel {
-  constructor(options: LoggerOutputModel.IOptions) {
-    super(options);
-
-    this.timestamp = new Date(options.value.timestamp as number);
-  }
-
-  timestamp: Date = null;
-}
-
-export namespace LoggerOutputModel {
-  export interface IOptions extends IOutputModel.IOptions {
-    value: IOutputWithTimestampType;
-  }
+  private _entryLimit: number = 1000;
 }
 
 /**
  * The default implementation of `IContentFactory`.
  */
-export class LoggerModelFactory extends OutputAreaModel.ContentFactory {
+export class LogConsoleContentFactory extends OutputArea.ContentFactory {
   /**
-   * Create an output model.
+   * Create the output prompt for the widget.
    */
-  createOutputModel(options: IOutputModel.IOptions): LoggerOutputModel {
-    return new LoggerOutputModel(options);
+  createOutputPrompt(): LogConsoleOutputPrompt {
+    return new LogConsoleOutputPrompt();
   }
 }
 
 /**
  * A List View widget that shows Output Console logs.
  */
-export class OutputLoggerView extends StackedPanel {
+export class LogConsolePanel extends StackedPanel {
   /**
    * Construct an OutputConsoleView instance.
    */
-  constructor(outputLogRegistry: IOutputLogRegistry) {
+  constructor(loggerRegistry: ILoggerRegistry) {
     super();
 
-    this._outputLogRegistry = outputLogRegistry;
+    this._loggerRegistry = loggerRegistry;
     this.addClass('jlab-output-logger-view');
     this.node.style.overflowY = 'auto'; // TODO: use CSS class
 
-    outputLogRegistry.registryChanged.connect(
-      (sender: IOutputLogRegistry, args: ILogRegistryChange) => {
+    loggerRegistry.registryChanged.connect(
+      (sender: ILoggerRegistry, args: ILoggerRegistryChange) => {
         this._bindLoggerSignals();
       },
       this
@@ -269,47 +304,49 @@ export class OutputLoggerView extends StackedPanel {
   }
 
   protected onAfterAttach(msg: Message): void {
-    this._updateOutputViews();
+    this._updateOutputAreas();
     this._showOutputFromSource(this._activeSource);
     this._showPlaceholderIfNoMessage();
   }
 
   private _bindLoggerSignals() {
-    const loggers = this._outputLogRegistry.getLoggers();
+    const loggers = this._loggerRegistry.getLoggers();
     for (let logger of loggers) {
       // TODO: optimize
       logger.logChanged.connect((sender: ILogger, args: ILoggerChange) => {
-        this._updateOutputViews();
+        this._updateOutputAreas();
         this._showPlaceholderIfNoMessage();
       }, this);
 
       logger.rendermimeChanged.connect((sender: ILogger) => {
         const viewId = `source:${sender.source}`;
-        const view = this._outputViews.get(viewId);
-        if (view) {
-          view.rendermime = sender.rendermime;
+        const outputArea = this._outputAreas.get(viewId);
+        if (outputArea) {
+          outputArea.rendermime = sender.rendermime;
         }
       }, this);
     }
   }
 
-  get outputLogRegistry(): IOutputLogRegistry {
-    return this._outputLogRegistry;
+  get loggerRegistry(): ILoggerRegistry {
+    return this._loggerRegistry;
   }
 
   private _showOutputFromSource(source: string) {
     const viewId = `source:${source}`;
 
-    this._outputViews.forEach((outputView: LoggerOutputArea, name: string) => {
-      if (outputView.id === viewId) {
-        outputView.show();
-        setTimeout(() => {
-          this._scrollOuputAreaToBottom(outputView);
-        }, 50);
-      } else {
-        outputView.hide();
+    this._outputAreas.forEach(
+      (outputArea: LogConsoleOutputArea, name: string) => {
+        if (outputArea.id === viewId) {
+          outputArea.show();
+          setTimeout(() => {
+            this._scrollOuputAreaToBottom(outputArea);
+          }, 50);
+        } else {
+          outputArea.hide();
+        }
       }
-    });
+    );
 
     const title = source ? `Log: ${source}` : 'Log Console';
     this.title.label = title;
@@ -329,7 +366,7 @@ export class OutputLoggerView extends StackedPanel {
   private _showPlaceholderIfNoMessage() {
     const noMessage =
       !this.activeSource ||
-      this._outputLogRegistry.getLogger(this.activeSource).length === 0;
+      this._loggerRegistry.getLogger(this.activeSource).length === 0;
 
     if (noMessage) {
       this._placeholder.show();
@@ -338,17 +375,17 @@ export class OutputLoggerView extends StackedPanel {
     }
   }
 
-  private _scrollOuputAreaToBottom(outputView: LoggerOutputArea) {
-    outputView.node.scrollTo({
+  private _scrollOuputAreaToBottom(outputArea: LogConsoleOutputArea) {
+    outputArea.node.scrollTo({
       left: 0,
-      top: outputView.node.scrollHeight,
+      top: outputArea.node.scrollHeight,
       behavior: 'smooth'
     });
   }
 
-  private _updateOutputViews() {
+  private _updateOutputAreas() {
     const loggerIds = new Set<string>();
-    const loggers = this._outputLogRegistry.getLoggers();
+    const loggers = this._loggerRegistry.getLoggers();
 
     for (let logger of loggers) {
       const viewId = `source:${logger.source}`;
@@ -356,43 +393,43 @@ export class OutputLoggerView extends StackedPanel {
 
       // add view for logger if not exist
       // TODO: or rendermime changed
-      if (!this._outputViews.has(viewId)) {
-        const outputView = new LoggerOutputArea({
+      if (!this._outputAreas.has(viewId)) {
+        const outputArea = new LogConsoleOutputArea({
           rendermime: logger.rendermime,
-          contentFactory: new LoggerContentFactory(),
+          contentFactory: new LogConsoleContentFactory(),
           model: logger.outputAreaModel
         });
-        outputView.id = viewId;
-        outputView.model.messageLimit = this.messageLimit;
+        outputArea.id = viewId;
+        outputArea.model.entryLimit = this.entryLimit;
 
         logger.logChanged.connect((sender: ILogger, args: ILoggerChange) => {
-          this._scrollOuputAreaToBottom(outputView);
+          this._scrollOuputAreaToBottom(outputArea);
         }, this);
 
-        outputView.outputLengthChanged.connect(
-          (sender: LoggerOutputArea, args: number) => {
-            outputView.model.applyLimit();
+        outputArea.outputLengthChanged.connect(
+          (sender: LogConsoleOutputArea, args: number) => {
+            outputArea.model.applyLimit();
             clearTimeout(this._scrollTimer);
             this._scrollTimer = setTimeout(() => {
-              this._scrollOuputAreaToBottom(outputView);
+              this._scrollOuputAreaToBottom(outputArea);
             }, 50);
           },
           this
         );
 
-        this.addWidget(outputView);
-        this._outputViews.set(viewId, outputView);
+        this.addWidget(outputArea);
+        this._outputAreas.set(viewId, outputArea);
       }
     }
 
     // remove views that do not have corresponding loggers anymore
-    const viewIds = this._outputViews.keys();
+    const viewIds = this._outputAreas.keys();
 
     for (let viewId of viewIds) {
       if (!loggerIds.has(viewId)) {
-        const outputView = this._outputViews.get(viewId);
-        outputView.dispose();
-        this._outputViews.delete(viewId);
+        const outputArea = this._outputAreas.get(viewId);
+        outputArea.dispose();
+        this._outputAreas.delete(viewId);
       }
     }
   }
@@ -400,63 +437,27 @@ export class OutputLoggerView extends StackedPanel {
   /**
    * Message entry limit.
    */
-  get messageLimit(): number {
-    return this._messageLimit;
+  get entryLimit(): number {
+    return this._entryLimit;
   }
 
   /**
    * Sets message entry limit.
    */
-  set messageLimit(limit: number) {
+  set entryLimit(limit: number) {
     if (limit > 0) {
-      this._outputViews.forEach((outputView: LoggerOutputArea) => {
-        const model = outputView.model;
-        model.messageLimit = limit;
+      this._outputAreas.forEach((outputView: LogConsoleOutputArea) => {
+        outputView.model.entryLimit = limit;
       });
 
-      this._messageLimit = limit;
+      this._entryLimit = limit;
     }
   }
 
-  private _outputLogRegistry: IOutputLogRegistry;
-  private _outputViews = new Map<string, LoggerOutputArea>();
+  private _loggerRegistry: ILoggerRegistry;
+  private _outputAreas = new Map<string, LogConsoleOutputArea>();
   private _activeSource: string = null;
-  private _messageLimit: number = 1000;
+  private _entryLimit: number = 1000;
   private _scrollTimer: number = null;
   private _placeholder: Widget;
 }
-
-/**
- * The default output prompt implementation
- */
-class LoggerOutputPrompt extends Widget implements IOutputPrompt {
-  constructor() {
-    super();
-
-    this._timestampNode = document.createElement('div');
-    this.node.append(this._timestampNode);
-  }
-
-  set timestamp(value: Date) {
-    this._timestampNode.innerHTML = value.toLocaleTimeString();
-  }
-
-  /**
-   * The execution count for the prompt.
-   */
-  executionCount: nbformat.ExecutionCount;
-
-  private _timestampNode: HTMLDivElement;
-}
-
-/**
- * The default implementation of `IContentFactory`.
- */
-export class LoggerContentFactory extends OutputArea.ContentFactory {
-  /**
-   * Create the output prompt for the widget.
-   */
-  createOutputPrompt(): LoggerOutputPrompt {
-    return new LoggerOutputPrompt();
-  }
-}