Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

356
Visualizações
Electron-log with file transport is forcing app reload

I am using the electron-todo template and trying to create a log file that recovers the data in the event of a crash. The app reloads every time the log file is updated. How would I prevent the app from reloading every time? I intended the logging to occur in the background while the app keeps running. In the renderer I have the following:

const path = require("path");
const log = require("electron-log");
log.transports.file.resolvePath = () => path.join("renderer", 'main.log');

document.getElementById('todoForm').addEventListener('submit', (evt) => {
  evt.preventDefault()
  const input = evt.target[0]
  ipcRenderer.send('add-todo', input.value)
  .then(()=>{
    log.info('Log todo:', input.value) //this is causing app to reload
  })
  .catch((err)=>{
    alert('Cannot log todo')
  })
})

I cannot see any console error output upon app reload, but the log file does record as it should.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda