summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-07 05:51:58 +0200
committernatrixaeria <janng@gmx.de>2019-05-07 05:53:38 +0200
commite2d83e09f8af95c82385967f61e2ec8342a4b2c9 (patch)
tree05157a440d2e74941c8ac417a56505bdcc94dd25
parent6d988d13f7fc1652e2d041cfd1c4b40dce6a8adb (diff)
Add a logging feature with pretty_env_logger
-rw-r--r--game_server/Cargo.toml2
-rwxr-xr-xgame_server/build.sh3
-rw-r--r--game_server/src/group.rs7
-rw-r--r--game_server/src/lobby.rs2
-rw-r--r--game_server/src/main.rs10
5 files changed, 22 insertions, 2 deletions
diff --git a/game_server/Cargo.toml b/game_server/Cargo.toml
index fba755c..f3aabed 100644
--- a/game_server/Cargo.toml
+++ b/game_server/Cargo.toml
@@ -6,4 +6,6 @@ edition = "2018"
description = "A general game server for connections to web clients. Currently (on the way to) deploying a skribbl.io like game."
[dependencies]
+log = "0.4"
+pretty_env_logger = "0.3"
rocket = "0.4"
diff --git a/game_server/build.sh b/game_server/build.sh
index 67e239f..9def83e 100755
--- a/game_server/build.sh
+++ b/game_server/build.sh
@@ -1,3 +1,4 @@
#!/usr/bin/env sh
-rustup run nightly cargo run
+rustup run nightly cargo build
+RUST_LOG=trace target/debug/game-server
diff --git a/game_server/src/group.rs b/game_server/src/group.rs
new file mode 100644
index 0000000..3241eee
--- /dev/null
+++ b/game_server/src/group.rs
@@ -0,0 +1,7 @@
+struct Group {
+ id: u32,
+ name: String,
+}
+
+impl Group {
+}
diff --git a/game_server/src/lobby.rs b/game_server/src/lobby.rs
new file mode 100644
index 0000000..c0717d3
--- /dev/null
+++ b/game_server/src/lobby.rs
@@ -0,0 +1,2 @@
+struct Lobby {
+}
diff --git a/game_server/src/main.rs b/game_server/src/main.rs
index e7a11a9..685c633 100644
--- a/game_server/src/main.rs
+++ b/game_server/src/main.rs
@@ -1,3 +1,11 @@
+mod lobby;
+mod group;
+
+#[macro_use] extern crate log;
+use pretty_env_logger;
+
fn main() {
- println!("Hello, world!");
+ pretty_env_logger::init();
+
+ trace!("test info");
}