Reduce production logs + button on error page for logs (#1565)

* reduce prod logs

* Open logs dir button on error page
This commit is contained in:
Oscar Beaumont 2023-10-13 19:50:01 +11:00 committed by GitHub
parent 25fa1f0974
commit 39744b5c55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View file

@ -169,7 +169,12 @@ impl Node {
.with(
tracing_fmt::Subscriber::new()
.with_ansi(false)
.with_writer(logfile),
.with_writer(logfile)
.with_filter(
EnvFilter::builder()
.from_env()?
.add_directive("info".parse()?),
),
)
.with(
tracing_fmt::Subscriber::new()

View file

@ -6,6 +6,7 @@ import { Button, Dialogs } from '@sd/ui';
import { showAlertDialog } from './components';
import { useOperatingSystem, useTheme } from './hooks';
import { usePlatform } from './util/Platform';
export function RouterErrorBoundary() {
const error = useRouteError();
@ -56,6 +57,7 @@ export function ErrorPage({
useTheme();
const debug = useDebugState();
const os = useOperatingSystem();
const platform = usePlatform();
const isMacOS = os === 'macOS';
const resetHandler = () => {
@ -97,11 +99,19 @@ export function ErrorPage({
Reload
</Button>
)}
{sendReportBtn && (
<Button variant="gray" className="mt-2" onClick={sendReportBtn}>
Send report
<Button
variant="gray"
className="mt-2"
onClick={() => (sendReportBtn ? sendReportBtn() : captureException(message))}
>
Send report
</Button>
{platform.openLogsDir && (
<Button variant="gray" className="mt-2" onClick={platform.openLogsDir}>
Open Logs
</Button>
)}
{(errorsThatRequireACoreReset.includes(message) ||
message.startsWith('NodeError::FailedToInitializeConfig') ||
message.startsWith('failed to initialize library manager')) && (