How to use the electron-log.log function in electron-log

To help you get started, we’ve selected a few electron-log 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 mdyna / mdyna-app / main.js View on Github external
]));
    cardStorage.set('state', {
      cards: currentCards || tempState.cards,
      labels: loadLabels(currentCards) || [],
    });

    // * Clear tmp/state key
    userStorage.delete('tmp/state');
  } else if (userCardsInStorage.length || userLabelsInStorage.length) {
    cardStorage.set('state', {
      cards: getUniqCardsById([...userCardsInStorage]) || tempState.cards,
      labels: loadLabels(userCardsInStorage) || [],
    });
    userStorage.delete('state');
  }
  logger.log('LOADED CARDS STORAGE', cardStorage.get('state'));
  global.cardStorage = cardStorage;
  global.userStorage = userStorage;

  // * CHANGE CWD EVENT
  ipcMain.on('CHANGED-CWD', () => {
    logger.info('CURRENT WORKING DIRECTORY CHANGED');
    const currentUserState = cardStorage.get('state');
    const newCwd = getCwd(userStorage.get('settings'));
    const newCardStorage = new Storage({
      name: 'mdyna-card-data',
      newCwd,
    });
    logger.info('PORTING STATE FROM OLD CWD [', cwd, '] TO [', newCwd, ']');
    logger.log(newCardStorage.get('state'), cardStorage.get('state'));
    if (currentUserState) {
      userStorage.set('tmp/state', currentUserState);
github antonycourtney / tad / src / csvimport.js View on Github external
return new Promise((resolve, reject) => {
    log.log('starting metascan...')
    const pathStats = fs.statSync(pathname)
    log.log('file size: ', pathStats.size)
    const msStart = process.hrtime()
    let firstRow = true
    var colTypes: Array
    let rowCount = 0
    // extract table name from file path:
    const tableName = genTableName(pathname)

    let csvOptions = { delimiter }
    const pathStream = fs.createReadStream(pathname)

    let gauge = new Gauge()

    const numREs = (delimiter === ';') ? eurNumREs : usNumREs
    const guessFunc = guessColumnType(numREs)
github ffxiv-teamcraft / ffxiv-teamcraft / desktop / main.js View on Github external
ipcMain.on('log', (event, entry) => {
  log.log(entry);
});
github jupyterlab / jupyterlab_app / src / browser / app.tsx View on Github external
this._server = {
            token: data.token,
            url: data.url,
            name: 'Local',
            type: 'local',
        };

        PageConfig.setOption('token', this._server.token);
        PageConfig.setOption('baseUrl', this._server.url);

        this._setupLab();

        try {
            this._lab.start({'ignorePlugins': this._ignorePlugins});
        } catch (e) {
            log.log(e);
        }
        this._lab.restored.then( () => {
            ipcRenderer.send('lab-ready');
            (this.refs.splash as SplashScreen).fadeSplashScreen();
        });
    }
github antonycourtney / tad / app / main.js View on Github external
const handleOpen = (event, filePath) => {
          log.log('handleOpen called!')
          log.warn('got open-file event for: ', filePath)
          event.preventDefault()
          const targetPath = getTargetPath(options, filePath)
          if (isReady) {
            log.warn('open-file: app is ready, opening in new window')
            appWindow.create(targetPath)
          } else {
            openFilePath = targetPath
            log.warn('open-file: set openFilePath ' + targetPath)
          }
        }
github jupyterlab / jupyterlab_app / src / browser / app.tsx View on Github external
private _connectionAdded(server: JupyterServer.IServer) {
        PageConfig.setOption('baseUrl', server.url);
        PageConfig.setOption('token', server.token);

        try {
            this._lab.start({'ignorePlugins': this._ignorePlugins});
        } catch (e) {
            log.log(e);
        }

        let rServer: Application.IRemoteServer = {...server, id: this._nextRemoteId++};
        this.setState((prevState: ServerManager.State) => {
            server.id = this._nextRemoteId++;
            let remotes = this.state.remotes.concat(rServer);
            this._saveState();
            return({
                renderState: this._renderEmpty,
                remotes: remotes
            });
        });
    }
github mdyna / mdyna-app / main.js View on Github external
autoUpdater.on('download-progress', (arg) => {
    logger.log('download-progress');
    logger.log(arg);
  });
github mdyna / mdyna-app / main / loaders.js View on Github external
function loadBoards(boards) {
  logger.log('LOADING BOARDS', boards);
  const boardNames = ['INBOX'];
  const boardList = [
    {
      name: 'INBOX',
      cards: 'all',
      bg: 'default',
      labels: 'all',
    },
  ];
  for (let i = 0; i < boards.length; i += 1) {
    const board = boards[i];
    const { name } = board;
    if (name && name !== 'INBOX') {
      boardList.push(board);
      boardNames.push(name);
    }
github mdyna / mdyna-app / index.js View on Github external
app.on('ready', () => {
  logger.log('Main Electron Logs');
  logger.error('Main Electron Logs');
  mainWindow = new BrowserWindow(MDYNA_WINDOW_OPTIONS);

  const splash = new BrowserWindow(SPLASH_WINDOW_OPTIONS);

  splash.loadURL(`file://${__dirname}/splash.html`);
  splash.show();

  runUpdater();

  const { webContents } = mainWindow;

  const handleRedirect = (e, url) => {
    if (url !== webContents.getURL()) {
      e.preventDefault();
      shell.openExternal(url);
github meetalva / alva / packages / core / src / hosts / electron-host / electron-host.ts View on Github external
public async log(message?: unknown, ...optionalParams: unknown[]): Promise {
		ElectronLog.log(message, ...optionalParams);
	}