The only regex in use is a pure ASCII-only match on a length-limited
string.
We don't need any extended feature of the regex library nor any
advanced performance improvements.
Depending on the new version allows us to reduce the feature set and
thus reduce the overall code size. This makes compilation of this crate
faster and the generated libraries smaller on all platforms.
This also removes the regex feature from the env_logger, as all we need
is some default logging during development/debugging/testing.
This unifies the naming scheme.
It's `glean-core`, not `glean_core`.
Cargo converts `-` (dash) to `_` (underscore) where necessary anyway,
but on the command line you need to pass the right name (e.g. on `cargo test -p glean-ffi`)
This initializes the logger through a "constructor", that is called before `main`.
This is safe to use, re-initializing the logger has no effect.
Log ouptut can be controlled via the environment variable `RUST_LOG` for the `glean_core` crate:
```
export RUST_LOG=glean_core=debug
```
When running tests you need to tell cargo to not suppress output:
```
cargo test -- --nocapture
```
Tests run in parallel by default, leading to interleaving log lines.
This makes it harder to understand what's going on.
For debugging you can force single-threaded tests:
```
cargo test -- --nocapture --test-threads=1
```
This makes sure that a proper log implementation
is available in the Rust core on non-Android
platforms. Additionally, this ensures that Kotlin
code redirects log calls to stdout.