* fix: rust modules are compiled twice
The modules being declared both in the _library_ crate and the _binary_
crate made cargo compile everything twice:
1. for the library
2. for the binary
What happened was:
1. The library "starship" was compiled.
2. The binary "starship" (and all its modules) were compiled.
* fix: stop compiling every rust module twice
restrict visibility
* Run cargo fmt
* Add bug_report module
Co-authored-by: Matan Kushner <hello@matchai.dev>
Co-authored-by: Kevin Song <chips@ksong.dev>
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.
- Create `Config` struct that is added to `Context` when initialized
- Read `~/.confg/starship.toml` during initialization (can be updated later to also look at `$XDG_CONFIG_HOME`)
- `Context` now has a method for creating modules. This allows us to provide modules with a reference to the configuration specific to that module