aboutsummaryrefslogtreecommitdiffstats
path: root/license-generator/src/lib.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-11-09 19:47:46 +0100
committerTeddy Wing2018-11-09 19:47:46 +0100
commit6aa6c70af607ede55f9dafef7278b192a2a6b9d0 (patch)
tree1afcc1fbe7479c8c2028768f84fce2f2658083dd /license-generator/src/lib.rs
parente8aa1429fa45957a2174446df64b62d407544d8b (diff)
downloaddome-key-web-6aa6c70af607ede55f9dafef7278b192a2a6b9d0.tar.bz2
Set up a file logger
Get a file path from the `LOG_FILE` environment variable and use it for log output. Call `database::get_database_connection()` and log the error if it fails. Worried about exiting early from the FastCGI program, as DreamHost says this causes problems (https://help.dreamhost.com/hc/en-us/articles/217298967). But I don't see how the program can continue without a database connection. Return a `Result` from `main()` because it's easier to use the `?` operator for errors that happen before logging is initialised.
Diffstat (limited to 'license-generator/src/lib.rs')
-rw-r--r--license-generator/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/license-generator/src/lib.rs b/license-generator/src/lib.rs
index e129d17..4dd726d 100644
--- a/license-generator/src/lib.rs
+++ b/license-generator/src/lib.rs
@@ -1,10 +1,11 @@
#[macro_use]
extern crate error_chain;
+extern crate log;
extern crate mysql;
extern crate rand;
extern crate sha1;
-mod database;
-mod errors;
+pub mod database;
+pub mod errors;
mod purchaser;