Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove emojies from logs #126

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) struct GameOptions {
}

pub(crate) fn on_connect(socket: SocketRef) {
debug!("🆕 Client connected with client id {}", socket.id);
debug!("Client connected with client id {}", socket.id);

socket.on(
"join",
Expand Down Expand Up @@ -67,7 +67,7 @@ pub(crate) fn on_connect(socket: SocketRef) {
socket.join("PRIMARY").unwrap();

info!(
"🪪 Client with ID {} set username to {}",
"Client with ID {} set username to {}",
socket.id, data.username
);
},
Expand All @@ -76,15 +76,15 @@ pub(crate) fn on_connect(socket: SocketRef) {
socket.on(
"guess",
|socket: SocketRef, Data::<packets::GuessPacket>(data), state: State<state::GameState>| async move {
debug!("📬 Received message: {:?}", data);
debug!("Received message: {:?}", data);
state.insert_guess(socket.id, data).await;
state.update_last_packet(socket.id).await;
},
);

socket.on_disconnect(|s: SocketRef, state: State<state::GameState>| async move {
state.remove_player(s.id).await;
debug!("🚪 User {} disconnected.", s.id);
debug!("User {} disconnected.", s.id);
});
}

Expand All @@ -102,7 +102,7 @@ pub(crate) async fn game_loop(opts: GameOptions, io: Arc<SocketIo>, state: state
index = 0;
}

debug!("📍 New location: {}, {}", &city.name, &city.country);
debug!("New location: {}, {}", &city.name, &city.country);
state.clear_guesses().await;

io.to("PRIMARY")
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_max_level(settings.logging.unwrap_or(cli::LoggingLevel::Info))
.init();

info!("👋 Sveio says hi!");
info!("Sveio says hi!");

server::create_server(server::ServerOptions {
game: game::GameOptions {
Expand All @@ -35,7 +35,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "shuttle")]
#[shuttle_runtime::main]
async fn main() -> shuttle_axum::ShuttleAxum {
info!("👋 Sveio says hi to Shuttle.rs!");
info!("Sveio says hi to Shuttle.rs!");

Ok(server::create_server(server::ServerOptions {
game: game::GameOptions {
Expand Down
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub(crate) async fn create_server(opts: ServerOptions) -> Option<axum::Router> {
)
.layer(TimeoutLayer::new(Duration::from_secs(2)));

info!("🎮 Starting game loop");
info!("Starting game loop");

let io_arc = Arc::new(io);
let game_io = Arc::clone(&io_arc);
Expand All @@ -61,12 +61,12 @@ pub(crate) async fn create_server(opts: ServerOptions) -> Option<axum::Router> {
});

if let Some(port) = opts.port {
info!("Starting HTTP server");
info!("Starting HTTP server");
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", port))
.await
.unwrap();

info!("Listening on http://{}", listener.local_addr().unwrap());
info!("Listening on http://{}", listener.local_addr().unwrap());
axum::serve(listener, app)
.with_graceful_shutdown(shutdown_signal(shutdown_io, opts.server_termination_kick))
.await
Expand Down
Loading