summaryrefslogtreecommitdiffstats
path: root/starship_module_config_derive
diff options
context:
space:
mode:
authorTilmann Meyer <allescrafterx@gmail.com>2020-09-28 22:38:50 +0200
committerGitHub <noreply@github.com>2020-09-28 16:38:50 -0400
commit22336834109a1659069acdfb1dfeb324206a9fc9 (patch)
treea3071d855ae1129817e000fb77932c1c5608cd6d /starship_module_config_derive
parent3c668e6e6ac0c0ee7dbe2ef69ede1e4a16ec1c9c (diff)
feat: add error messaging (#1576)
This creates a custom logger for the log crate which logs everything to a file (/tmp/starship/session_$STARSHIP_SESSION_KEY.log) and it logs everything above Warn to stderr, but only if the log file does not contain the line that should be logged resulting in an error or warning to be only logged at the first starship invocation after opening the shell.
Diffstat (limited to 'starship_module_config_derive')
-rw-r--r--starship_module_config_derive/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/starship_module_config_derive/src/lib.rs b/starship_module_config_derive/src/lib.rs
index db2e275eb..b6d11326a 100644
--- a/starship_module_config_derive/src/lib.rs
+++ b/starship_module_config_derive/src/lib.rs
@@ -1,6 +1,3 @@
-extern crate proc_macro;
-extern crate proc_macro2;
-
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};
@@ -50,6 +47,9 @@ fn impl_module_config(dinput: DeriveInput) -> proc_macro::TokenStream {
fn load_config(&self, config: &'a toml::Value) -> Self {
let mut new_module_config = self.clone();
if let toml::Value::Table(config) = config {
+ if config.get("prefix").is_some() || config.get("suffix").is_some() {
+ log::warn!("You're using the outdated config format! Migrate your config here: https://starship.rs/migrating-to-0.45.0/")
+ }
#load_tokens
}
new_module_config