Merge pull request #1967 from warrickct/debug-log-qol

Debug log qol
pull/1979/head
Audric Ackermann 4 years ago committed by GitHub
commit b5e5bc95b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -73,6 +73,7 @@
"attemptingReconnection": "Attempting reconnect in $reconnect_duration_in_seconds$ seconds",
"submitDebugLog": "Debug log",
"debugLog": "Debug Log",
"showDebugLog": "Show Debug Log",
"goToReleaseNotes": "Go to Release Notes",
"goToSupportPage": "Go to Support Page",
"menuReportIssue": "Report an Issue",

@ -22,5 +22,9 @@ window.getNodeVersion = () => config.node_version;
window.getEnvironment = () => config.environment;
require('./js/logging');
const os = require('os');
window.getOSRelease = () => `${os.type()} ${os.release} ${os.platform()}`;
window.getCommitHash = () => config.commitHash;
window.closeDebugLog = () => ipcRenderer.send('close-debug-log');

@ -26,9 +26,15 @@
this.render();
this.$('textarea').val(i18n('loading'));
const operatingSystemInfo = `Operating System: ${window.getOSRelease()}`;
const commitHashInfo = window.getCommitHash() ? `Commit Hash: ${window.getCommitHash()}` : '';
// eslint-disable-next-line more/no-then
window.log.fetch().then(text => {
this.$('textarea').val(text);
const debugLogWithSystemInfo = operatingSystemInfo + commitHashInfo + text;
this.$('textarea').val(debugLogWithSystemInfo);
});
},
events: {

@ -1,3 +1,4 @@
import { ipcRenderer } from 'electron';
import React from 'react';
import styled from 'styled-components';
import { MessageDeliveryStatus } from '../../../models/messageType';
@ -40,8 +41,12 @@ const MessageStatusRead = () => {
};
const MessageStatusError = () => {
const showDebugLog = () => {
ipcRenderer.send('show-debug-log');
};
return (
<MessageStatusSendingContainer title={window.i18n('sendFailed')}>
<MessageStatusSendingContainer onClick={showDebugLog} title={window.i18n('sendFailed')}>
<SessionIcon iconColor={'var(--color-destructive'} iconType="error" iconSize={'tiny'} />
</MessageStatusSendingContainer>
);

@ -14,7 +14,7 @@ import {
getPasswordHash,
hasLinkPreviewPopupBeenDisplayed,
} from '../../../../ts/data/data';
import { shell } from 'electron';
import { ipcRenderer, shell } from 'electron';
import { mapDispatchToProps } from '../../../state/actions';
import { unblockConvoById } from '../../../interactions/conversationInteractions';
import { toggleAudioAutoplay } from '../../../state/ducks/userConfig';
@ -497,6 +497,23 @@ class SettingsViewInner extends React.Component<SettingsViewProps, State> {
buttonColor: SessionButtonColor.Primary,
},
},
{
id: 'debug-log-setting',
title: window.i18n('showDebugLog'),
description: undefined,
hidden: false,
type: SessionSettingType.Button,
category: SessionSettingCategory.Appearance,
setFn: undefined,
comparisonValue: undefined,
onClick: () => {
ipcRenderer.send('show-debug-log');
},
content: {
buttonText: window.i18n('debugLog'),
buttonColor: SessionButtonColor.Primary,
},
},
{
id: 'media-permissions',
title: window.i18n('mediaPermissionsTitle'),

Loading…
Cancel
Save