Compare commits

...

2 Commits

Author SHA1 Message Date
Audric Ackermann 48a245e13c
Merge pull request #3082 from Aerilym/chore/rename_fetch_functions
Rename fetch functions
4 weeks ago
Ryan Miller 87fb1701d4
chore: rename fetch functions 4 weeks ago

@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { switchThemeTo } from '../themes/switchTheme';
import { SessionTheme } from '../themes/SessionTheme';
import { fetch } from '../util/logging';
import { fetchNodeLog } from '../util/logging';
import { SessionButton, SessionButtonType } from './basic/SessionButton';
import { SessionIconButton } from './icon';
@ -78,7 +78,7 @@ const DebugLogViewAndSave = () => {
const commitHashInfo = window.getCommitHash() ? `Commit Hash: ${window.getCommitHash()}` : '';
// eslint-disable-next-line more/no-then
fetch()
fetchNodeLog()
.then((text: any) => {
const debugLogWithSystemInfo = `${operatingSystemInfo} ${commitHashInfo} ${text}`;
setContent(debugLogWithSystemInfo);

@ -63,7 +63,7 @@ export async function initializeLogger() {
fs.mkdirSync(logPath, { recursive: true });
console.info('fetching logs from logPath');
fetch(logPath).then(
fetchLogFile(logPath).then(
data => {
event.sender.send('fetched-log', data);
},
@ -218,7 +218,7 @@ async function fetchLog(logFile: string) {
});
}
export async function fetch(logPath: string) {
export async function fetchLogFile(logPath: string) {
// Check that the file exists locally
if (!fs.existsSync(logPath)) {
(console as ConsoleCustom)._log(

@ -94,7 +94,7 @@ function format(entries: Array<EntryType>) {
return redactAll(entries.map(formatLine).join('\n'));
}
export async function fetch() {
export async function fetchNodeLog() {
return new Promise(resolve => {
ipc.on('fetched-log', (_event, text) => {
const result = `${getHeader()}\n${format(text)}`;

Loading…
Cancel
Save