mirror of
https://github.com/niushuai233/DevControl.git
synced 2024-10-27 22:43:20 +08:00
feat: 增加打印日志内容
This commit is contained in:
parent
d9b4c6260f
commit
09a244d88d
@ -21,5 +21,6 @@ public interface Keys {
|
|||||||
|
|
||||||
String APP_INIT = "AppInit";
|
String APP_INIT = "AppInit";
|
||||||
String KEEP_DAY_SELECT = "KeepDaySelect";
|
String KEEP_DAY_SELECT = "KeepDaySelect";
|
||||||
|
String APP_SETUP = "AppSetup";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,10 +45,11 @@ public class KeepDayDialogFragment extends DialogFragment {
|
|||||||
private void addListener() {
|
private void addListener() {
|
||||||
binding.layoutLogKeepDayConfirm.setOnClickListener(v -> {
|
binding.layoutLogKeepDayConfirm.setOnClickListener(v -> {
|
||||||
int value = binding.keepDayPicker.getValue();
|
int value = binding.keepDayPicker.getValue();
|
||||||
XLog.KEEP_DAY = value;
|
|
||||||
String keepDayPickerValue = value + "";
|
String keepDayPickerValue = value + "";
|
||||||
DBHelper.configDeal(Keys.SETUP_LOG_KEEP_DAY, keepDayPickerValue);
|
DBHelper.configDeal(Keys.SETUP_LOG_KEEP_DAY, keepDayPickerValue);
|
||||||
XLog.v(Keys.Tag.KEEP_DAY_SELECT, "更新日志存储天数为: {}", keepDayPickerValue);
|
|
||||||
|
XLog.KEEP_DAY = value;
|
||||||
|
XLog.i(Keys.Tag.KEEP_DAY_SELECT, "更新日志存储天数为: {}", keepDayPickerValue);
|
||||||
|
|
||||||
((TextView)getActivity().findViewById(R.id.setup_log_keep_day_display)).setText(keepDayPickerValue);
|
((TextView)getActivity().findViewById(R.id.setup_log_keep_day_display)).setText(keepDayPickerValue);
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
|
@ -79,9 +79,12 @@ public class NavSetUpFragment extends BaseFragment {
|
|||||||
binding.setupLogLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
binding.setupLogLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
String level = ((Spinner) parent.findViewById(R.id.setup_log_level_spinner)).getSelectedItem().toString();
|
String levelName = ((Spinner) parent.findViewById(R.id.setup_log_level_spinner)).getSelectedItem().toString();
|
||||||
|
DBHelper.configDeal(Keys.SETUP_LOG_LEVEL, levelName);
|
||||||
|
|
||||||
DBHelper.configDeal(Keys.SETUP_LOG_LEVEL, level);
|
XLog.ROOT_LEVEL = XLog.Level.transform(levelName);
|
||||||
|
XLog.ROOT_LEVEL_NAME = levelName;
|
||||||
|
XLog.i(Keys.Tag.APP_SETUP, "修改日志级别为: {}", XLog.ROOT_LEVEL_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -110,9 +113,8 @@ public class NavSetUpFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void setupLogSwitchClickListener(View view) {
|
private void setupLogSwitchClickListener(View view) {
|
||||||
Boolean checked = binding.setupLogSwitchSwitch.isChecked();
|
Boolean checked = binding.setupLogSwitchSwitch.isChecked();
|
||||||
XLog.SWITCH = checked;
|
|
||||||
|
|
||||||
DBHelper.configDeal(Keys.SETUP_LOG_SWITCH, checked.toString());
|
DBHelper.configDeal(Keys.SETUP_LOG_SWITCH, checked.toString());
|
||||||
|
XLog.SWITCH = checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupKeepDayClickListener(View view) {
|
private void setupKeepDayClickListener(View view) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user