0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-04-07 23:41:43 -05:00

Clarify language for Verbose Logging setting (#9237)

This commit is contained in:
Nate Moore 2023-12-01 10:25:11 -06:00 committed by GitHub
parent 4f344b8bc7
commit 5ab008da8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -25,17 +25,21 @@ const settingsRows = [
}
settings.updateSetting('disablePluginNotification', evt.currentTarget.checked);
const action = evt.currentTarget.checked ? 'enabled' : 'disabled';
settings.log(`Plugin notification badges ${action}`);
}
},
},
{
name: 'Verbose logging',
description: 'Log additional information to the console.',
description: 'Logs dev overlay events in the browser console.',
input: 'checkbox',
settingKey: 'verbose',
changeEvent: (evt: Event) => {
if (evt.currentTarget instanceof HTMLInputElement) {
settings.updateSetting('verbose', evt.currentTarget.checked);
const action = evt.currentTarget.checked ? 'enabled' : 'disabled';
settings.log(`Verbose logging ${action}`);
}
},
},

View file

@ -23,10 +23,16 @@ function getSettings() {
localStorage.setItem('astro:dev-overlay:settings', JSON.stringify(_settings));
}
function log(message: string) {
// eslint-disable-next-line no-console
console.log(`%cAstro`, 'background: linear-gradient(66.77deg, #D83333 0%, #F041FF 100%); color: white; padding-inline: 4px; border-radius: 2px; font-family: monospace;', message);
}
return {
get config() {
return _settings;
},
updateSetting,
log
};
}