How to use console-feed - 10 common examples

To help you get started, we’ve selected a few console-feed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HendrixString / adobe-cep-react-create / src / client-src / comps / Debug.jsx View on Github external
componentDidMount() {
        // iniitial logz
        const { rawLogz } = this.props

        // also listen
        Hook(window.console, (log) => {
            this.setState((state) => {
                var logz = state.logs.slice()
                logz.push(Decode(log))
                return {
                    logs: logz
                }

            })

        })

        // replay initial logs
        console.log(...rawLogz)
    }
github nscozzaro / physics-is-beautiful / courses / static / courses / js / containers / StudioViews / EditorsViews / containers / LessonWorkSpace / Codesandbox / app / components / Preview / DevTools / Console / index.tsx View on Github external
handleMessage = data => {
    switch (data.type) {
      case 'console': {
        const message = Decode(data.log);
        const { method, data: args } = message;

        switch (method) {
          case 'clear': {
            // If the event was done by the packager
            const hideMessage = args && args[0] === '__internal__';

            this.clearConsole(hideMessage);
            break;
          }
          default: {
            this.addMessage(method, args);
            break;
          }
        }
        break;
github codesandbox / codesandbox-client / packages / app / src / app / components / Preview / DevTools / Console / index.tsx View on Github external
handleMessage = data => {
    switch (data.type) {
      case 'console': {
        const message = Decode(data.log);
        const { method, data: args } = message;

        switch (method) {
          case 'clear': {
            // If the event was done by the packager
            const hideMessage = args && args[0] === '__internal__';

            this.clearConsole(hideMessage);
            break;
          }
          default: {
            this.addMessage(method, args);
            break;
          }
        }
        break;
github devuxd / SeeCodeRun / scr-app / src / components / Console.js View on Github external
handleMessage = data => {
        switch (data.type) {
            case 'console': {
                const message = Decode(data.log);
                const {method, data: args} = message;

                switch (method) {
                    case 'clear': {
                        // If the event was done by the packager
                        const hideMessage = args && args[0] === '__internal__';

                        this.clearConsole(hideMessage);
                        break;
                    }
                    default: {
                        this.addMessage(method, args);
                        break;
                    }
                }
                break;
github codesandbox / codesandbox-client / packages / app / src / sandbox / compile-old.js View on Github external
initializeResizeListener();
    }

    // Testing
    const ttt = Date.now();
    const testRunner = manager.testRunner;
    try {
      testRunner.initialize();
      testRunner.findTests(modules);
      await testRunner.runTests();
      const aggregatedResults = testRunner.reportResults();
      debug(`Test Evaluation time: ${Date.now() - ttt}ms`);

      dispatch({
        type: 'test-result',
        result: Encode(aggregatedResults),
      });
      // End - Testing
    } catch (error) {
      dispatch({
        type: 'test-result',
        error: testRunner.reportError(error),
      });
    }

    debug(`Total time: ${Date.now() - startTime}ms`);

    dispatch({
      type: 'success',
    });

    firstLoad = false;
github nscozzaro / physics-is-beautiful / courses / static / courses / js / containers / StudioViews / EditorsViews / containers / LessonWorkSpace / Codesandbox / app / components / Preview / DevTools / Console / index.tsx View on Github external
case 'eval-result': {
        const { result, error } = data;

        const decoded = Decode(result);

        if (!error) {
          this.addMessage('result', [decoded]);
        } else {
          this.addMessage('error', [decoded]);
        }
        break;
      }
      case 'test-result': {
        const { result, error } = data;

        const aggregatedResults = Decode(result);
        if (!error) {
          if (aggregatedResults) {
            const { summaryMessage, failedMessages } = aggregatedResults;
            this.addMessage('log', [summaryMessage]);
            failedMessages.forEach(t => {
              this.addMessage('warn', [t]);
            });
          } else {
            this.addMessage('warn', [undefined]);
          }
        } else {
          this.addMessage('error', [error]);
        }
        break;
      }
      case 'search-log': {
github devuxd / SeeCodeRun / scr-app / src / components / Console.js View on Github external
case 'eval-result': {
                const {result, error} = data;

                const decoded = Decode(result);

                if (!error) {
                    this.addMessage('result', [decoded]);
                } else {
                    this.addMessage('error', [decoded]);
                }
                break;
            }
            case 'test-result': {
                const {result, error} = data;

                const aggregatedResults = Decode(result);
                if (!error) {
                    if (aggregatedResults) {
                        const {summaryMessage, failedMessages} = aggregatedResults;
                        this.addMessage('log', [summaryMessage]);
                        failedMessages.forEach(t => {
                            this.addMessage('warn', [t]);
                        });
                    } else {
                        this.addMessage('warn', [undefined]);
                    }
                } else {
                    this.addMessage('error', [error]);
                }
                break;
            }
            default: {
github codesandbox / codesandbox-client / packages / app / src / app / components / Preview / DevTools / Console / index.tsx View on Github external
break;
      }
      case 'clear-console': {
        if (this.state.initialClear) {
          this.setState({
            initialClear: false,
          });
        } else {
          this.clearConsole();
        }
        break;
      }
      case 'eval-result': {
        const { result, error } = data;

        const decoded = Decode(result);

        if (!error) {
          this.addMessage('result', [decoded]);
        } else {
          this.addMessage('error', [decoded]);
        }
        break;
      }
      case 'test-result': {
        const { result, error } = data;

        const aggregatedResults = Decode(result);
        if (!error) {
          if (aggregatedResults) {
            const { summaryMessage, failedMessages } = aggregatedResults;
            this.addMessage('log', [summaryMessage]);
github HendrixString / adobe-cep-react-create / src / client-src / comps / Debug.jsx View on Github external
this.setState((state) => {
                var logz = state.logs.slice()
                logz.push(Decode(log))
                return {
                    logs: logz
                }

            })

console-feed

A React component that displays console logs from the current page, an iframe or transported across a server

MIT
Latest version published 8 months ago

Package Health Score

68 / 100
Full package analysis