more logging

This commit is contained in:
Brandon Thomas committed 2021-05-19 01:50:25 -04:00
1 parent 15ed33d1c4
commit bdd196308b
2 files changed
+9

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
*secret*sh
*~
.env
.idea/
+8
View File
@@ -38,11 +38,17 @@ pub type AnyhowResult<T> = anyhow::Result<T>;
async fn main() -> AnyhowResult<()> {
easyenv::init_all_with_default_logging(Some(DEFAULT_RUST_LOG));
info!("Obtaining hostname...");
let server_hostname = hostname::get()
.ok()
.and_then(|h| h.into_string().ok())
.unwrap_or("storyteller-web-unknown".to_string());
info!("Hostname: {}", &server_hostname);
info!("Connecting to database...");
let db_connection_string =
easyenv::get_env_string_or_default(
"MYSQL_URL",
@@ -53,6 +59,8 @@ async fn main() -> AnyhowResult<()> {
.connect(&db_connection_string)
.await?;
info!("Reading env vars and setting up utils...");
let hmac_secret = easyenv::get_env_string_or_default("COOKIE_SECRET", "notsecret");
let cookie_domain = easyenv::get_env_string_or_default("COOKIE_DOMAIN", ".vo.codes");