feat: adds trace events to server

This commit is contained in:
Avery Harnish
2020-03-03 12:31:49 -06:00
parent 80511f2cb5
commit 2b6b19ebc3
7 changed files with 651 additions and 7 deletions

View File

@@ -1,9 +1,13 @@
use clap::Clap;
use mini_redis::{server, DEFAULT_PORT};
use std::io;
use anyhow::{anyhow, Result};
#[tokio::main]
pub async fn main() -> io::Result<()> {
pub async fn main() -> Result<()> {
// enable logging
// see https://docs.rs/tracing for more info
tracing_subscriber::fmt::try_init().map_err(|e| anyhow!("{:?}", e))?;
let cli = Cli::parse();
let port = cli.port.unwrap_or(DEFAULT_PORT.to_string());
server::run(&port).await