What the Worker writes about a request: a route from a closed list, a method word, a status and a time. There is no field a visitor's address, query or headers could be put in.
4pub use aldebaran_log::{Method, Served};
6use crate::content::{CARD_PATH, FILES};
Every kind of thing the site answers. A path is turned into one of these before anything is
logged, so a made-up path is Other, never its own text.
23impl Route { 24 pub fn of(path: &str) -> Route { 25 match path { 26 "/" => Route::Page, 27 "/ui.js" => Route::Script, 28 "/ui.css" => Route::Style, 29 p if p.starts_with("/fonts/") => Route::Font, 30 "/favicon.svg" => Route::Icon, 31 p if FILES.find(p).is_some() => Route::Shot, 32 CARD_PATH => Route::Card, 33 "/robots.txt" => Route::Robots, 34 _ => Route::Other, 35 } 36 } 37} 38 39impl aldebaran_log::Route for Route { 40 fn name(self) -> &'static str { 41 match self { 42 Route::Page => "page", 43 Route::Script => "script", 44 Route::Style => "style", 45 Route::Font => "font", 46 Route::Icon => "icon", 47 Route::Shot => "shot", 48 Route::Card => "card", 49 Route::Robots => "robots", 50 Route::Other => "other", 51 } 52 }
A missing card is the build's fault, never a visitor's: say what to run.
The log names a route, never a path: anything not on the list is one word.