You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/frontend/src/Settings/General/LoggingSettings.js

49 lines
1.2 KiB

import PropTypes from 'prop-types';
import React from 'react';
import { inputTypes } from 'Helpers/Props';
import FieldSet from 'Components/FieldSet';
import FormGroup from 'Components/Form/FormGroup';
import FormLabel from 'Components/Form/FormLabel';
import FormInputGroup from 'Components/Form/FormInputGroup';
const logLevelOptions = [
{ key: 'info', value: 'Info' },
{ key: 'debug', value: 'Debug' },
{ key: 'trace', value: 'Trace' }
];
function LoggingSettings(props) {
const {
settings,
onInputChange
} = props;
const {
logLevel
} = settings;
return (
<FieldSet legend="Logging">
<FormGroup>
<FormLabel>Log Level</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
name="logLevel"
values={logLevelOptions}
helpTextWarning={logLevel.value === 'trace' ? 'Trace logging should only be enabled temporarily' : undefined}
onChange={onInputChange}
{...logLevel}
/>
</FormGroup>
</FieldSet>
);
}
LoggingSettings.propTypes = {
settings: PropTypes.object.isRequired,
onInputChange: PropTypes.func.isRequired
};
export default LoggingSettings;