Skip to content

Commit

Permalink
Trace log level on examples
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Jul 2, 2023
1 parent 8843f52 commit 1eebb90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/basic/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait Example {
}

fn main() {
set_log_level(Level::Debug);
set_log_level(Level::Trace);
let examples: Vec<Box<dyn Example>> = vec![
Box::new(basic::Basic),
Box::new(serve_file::ServeFile),
Expand Down
6 changes: 4 additions & 2 deletions lib/internal/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use std::net::{Ipv4Addr, Ipv6Addr};
use std::sync::{Mutex, MutexGuard};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::{borrow::Cow, net::IpAddr};

use crate::error::{Result, StartupError};
Expand Down Expand Up @@ -113,7 +112,10 @@ pub(crate) fn any_string(any: Box<dyn std::any::Any + Send>) -> Cow<'static, str

/// Get the current time since the Unix Epoch.
/// Will panic if the system time is before the Unix Epoch.
pub(crate) fn epoch() -> Duration {
#[cfg(any(feature = "extensions", docsrs))]
pub(crate) fn epoch() -> std::time::Duration {
use std::time::{SystemTime, UNIX_EPOCH};

SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("System time is before the Unix Epoch. Make sure your date is set correctly.")
Expand Down

0 comments on commit 1eebb90

Please sign in to comment.