diff options
author | Nathan Lilienthal <nathan@nixpulvis.com> | 2019-01-06 19:06:57 -0500 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-01-07 00:06:57 +0000 |
commit | 04707cbba630e3e4ad6b4200bef8ae7888c49e3b (patch) | |
tree | bd04f4964d4c4ad67cd565b38172b488172acfcc | |
parent | dfc30eeef5eb6df9f658e62875e5cde93173e37b (diff) |
Normalize Log Message Strings
The general style for errors, warnings and info messages is to start
with a capitalized letter and end without a period. The main exception
is when dealing with nouns that are clearer with special case handling,
e.g. "macOS failed to work" or "ioctl is borked".
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | copypasta/src/windows.rs | 2 | ||||
-rw-r--r-- | copypasta/src/x11.rs | 12 | ||||
-rw-r--r-- | font/src/darwin/mod.rs | 11 | ||||
-rw-r--r-- | font/src/ft/fc/font_set.rs | 4 | ||||
-rw-r--r-- | font/src/ft/mod.rs | 14 | ||||
-rw-r--r-- | font/src/lib.rs | 2 | ||||
-rw-r--r-- | font/src/rusttype/mod.rs | 8 | ||||
-rw-r--r-- | src/ansi.rs | 2 | ||||
-rw-r--r-- | src/config.rs | 108 | ||||
-rw-r--r-- | src/display.rs | 9 | ||||
-rw-r--r-- | src/event_loop.rs | 12 | ||||
-rw-r--r-- | src/grid/tests.rs | 4 | ||||
-rw-r--r-- | src/input.rs | 14 | ||||
-rw-r--r-- | src/logging.rs | 27 | ||||
-rw-r--r-- | src/main.rs | 10 | ||||
-rw-r--r-- | src/renderer/mod.rs | 35 | ||||
-rw-r--r-- | src/term/mod.rs | 100 | ||||
-rw-r--r-- | src/tty/unix.rs | 2 | ||||
-rw-r--r-- | src/tty/windows/mod.rs | 4 | ||||
-rw-r--r-- | winpty/src/windows.rs | 8 |
21 files changed, 197 insertions, 192 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 21a97e55..25a593b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Log messages are now consistent in style, and some have been removed - Windows configuration location has been moved from %USERPROFILE%\alacritty.yml to %APPDATA%\alacritty\alacritty.yml - Windows default shell is now PowerShell instead of cmd diff --git a/copypasta/src/windows.rs b/copypasta/src/windows.rs index 8ec783b2..95e3db55 100644 --- a/copypasta/src/windows.rs +++ b/copypasta/src/windows.rs @@ -13,7 +13,7 @@ pub enum Error { impl ::std::error::Error for Error { fn description(&self) -> &str { match *self { - Error::Clipboard(..) => "error opening clipboard", + Error::Clipboard(..) => "Error opening clipboard", } } } diff --git a/copypasta/src/x11.rs b/copypasta/src/x11.rs index 4c58c0a4..c7d9c696 100644 --- a/copypasta/src/x11.rs +++ b/copypasta/src/x11.rs @@ -35,9 +35,9 @@ impl ::std::error::Error for Error { fn description(&self) -> &str { match *self { - Error::Io(..) => "error calling xclip", - Error::Xclip(..) => "error reported by xclip", - Error::Utf8(..) => "clipboard contents not utf8", + Error::Io(..) => "Error calling xclip", + Error::Xclip(..) => "Error reported by xclip", + Error::Utf8(..) => "Clipboard contents not utf8", } } } @@ -50,11 +50,11 @@ impl ::std::fmt::Display for Error { io::ErrorKind::NotFound => { write!(f, "Please install `xclip` to enable clipboard support") }, - _ => write!(f, "error calling xclip: {}", err), + _ => write!(f, "Error calling xclip: {}", err), } }, - Error::Xclip(ref s) => write!(f, "error from xclip: {}", s), - Error::Utf8(ref err) => write!(f, "error parsing xclip output: {}", err), + Error::Xclip(ref s) => write!(f, "Error from xclip: {}", s), + Error::Utf8(ref err) => write!(f, "Error parsing xclip output: {}", err), } } } diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index 0e694f16..60b1a3e7 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -101,9 +101,9 @@ pub enum Error { impl ::std::error::Error for Error { fn description(&self) -> &str { match *self { - Error::MissingGlyph(ref _c) => "couldn't find the requested glyph", - Error::MissingFont(ref _desc) => "couldn't find the requested font", - Error::FontNotLoaded => "tried to operate on font that hasn't been loaded", + Error::MissingGlyph(ref _c) => "Couldn't find the requested glyph", + Error::MissingFont(ref _desc) => "Couldn't find the requested font", + Error::FontNotLoaded => "Tried to operate on font that hasn't been loaded", } } } @@ -129,7 +129,6 @@ impl ::Rasterize for Rasterizer { type Err = Error; fn new(device_pixel_ratio: f32, use_thin_strokes: bool) -> Result<Rasterizer, Error> { - info!("device_pixel_ratio: {}", device_pixel_ratio); Ok(Rasterizer { fonts: HashMap::new(), keys: HashMap::new(), @@ -332,7 +331,7 @@ fn cascade_list_for_languages( pub fn descriptors_for_family(family: &str) -> Vec<Descriptor> { let mut out = Vec::new(); - info!("family: {}", family); + trace!("Family: {}", family); let ct_collection = match create_for_family(family) { Some(c) => c, None => return out, @@ -627,7 +626,7 @@ mod tests { fn get_descriptors_and_build_font() { let list = super::descriptors_for_family("Menlo"); assert!(!list.is_empty()); - info!("{:?}", list); + println!("{:?}", list); // Check to_font let fonts = list.iter() diff --git a/font/src/ft/fc/font_set.rs b/font/src/ft/fc/font_set.rs index 6b63f439..4eccd487 100644 --- a/font/src/ft/fc/font_set.rs +++ b/font/src/ft/fc/font_set.rs @@ -63,7 +63,7 @@ impl<'a> IntoIterator for &'a FontSet { (*self.as_ptr()).nfont as isize }; - info!("num fonts = {}", num_fonts); + trace!("Number of fonts is {}", num_fonts); Iter { font_set: self.deref(), @@ -81,7 +81,7 @@ impl<'a> IntoIterator for &'a FontSetRef { (*self.as_ptr()).nfont as isize }; - info!("num fonts = {}", num_fonts); + trace!("Number of fonts is {}", num_fonts); Iter { font_set: self, diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 1d375295..6bcda2a1 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -117,7 +117,7 @@ impl ::Rasterize for FreeTypeRasterizer { }, _ => { // Fallback if font doesn't provide info about strikeout - trace!("No strikeout data available for font, using fallback."); + trace!("Using fallback strikeout metrics"); let strikeout_position = height as f32 / 2. + descent; (strikeout_position, underline_thickness) }, @@ -267,7 +267,7 @@ impl FreeTypeRasterizer { return Ok(Some(*key)); } - trace!("got font path={:?}", path); + trace!("Got font path={:?}", path); let ft_face = self.library.new_face(&path, index)?; // Get available pixel sizes if font isn't scalable. @@ -550,12 +550,12 @@ impl FreeTypeRasterizer { // We've previously loaded this font, so don't // load it again. Some(&key) => { - debug!("Hit for font {:?}; no need to load.", path); + debug!("Hit for font {:?}; no need to load", path); Ok(key) }, None => { - debug!("Miss for font {:?}; loading now.", path); + debug!("Miss for font {:?}; loading now", path); // Safe to unwrap the option since we've already checked for the path // and index above. let key = self.face_from_pattern(&pattern)?.unwrap(); @@ -604,9 +604,9 @@ impl ::std::error::Error for Error { fn description(&self) -> &str { match *self { Error::FreeType(ref err) => err.description(), - Error::MissingFont(ref _desc) => "couldn't find the requested font", - Error::FontNotLoaded => "tried to operate on font that hasn't been loaded", - Error::MissingSizeMetrics => "tried to get size metrics from a face without a size", + Error::MissingFont(ref _desc) => "Couldn't find the requested font", + Error::FontNotLoaded => "Tried to operate on font that hasn't been loaded", + Error::MissingSizeMetrics => "Tried to get size metrics from a face without a size", } } } diff --git a/font/src/lib.rs b/font/src/lib.rs index fdba4b87..6fc418dd 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -132,7 +132,7 @@ impl FontDesc { impl fmt::Display for FontDesc { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "name '{}' and style '{}'", self.name, self.style) + write!(f, "name {} and style {}", self.name, self.style) } } diff --git a/font/src/rusttype/mod.rs b/font/src/rusttype/mod.rs index bd4b8df1..add23605 100644 --- a/font/src/rusttype/mod.rs +++ b/font/src/rusttype/mod.rs @@ -166,10 +166,10 @@ pub enum Error { impl ::std::error::Error for Error { fn description(&self) -> &str { match *self { - Error::MissingFont(ref _desc) => "couldn't find the requested font", - Error::UnsupportedFont => "only TrueType fonts are supported", - Error::UnsupportedStyle => "the selected style is not supported by rusttype", - Error::MissingGlyph => "the selected font did not have the requested glyph", + Error::MissingFont(ref _desc) => "Couldn't find the requested font", + Error::UnsupportedFont => "Only TrueType fonts are supported", + Error::UnsupportedStyle => "The selected style is not supported by rusttype", + Error::MissingGlyph => "The selected font does not have the requested glyph", } } } diff --git a/src/ansi.rs b/src/ansi.rs index 29b1a459..34a765f7 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -445,7 +445,7 @@ impl Mode { 1049 => Mode::SwapScreenAndSetRestoreCursor, 2004 => Mode::BracketedPaste, _ => { - trace!("[unhandled] mode={:?}", num); + trace!("[unimplemented] primitive mode: {}", num); return None } }) diff --git a/src/config.rs b/src/config.rs index 95989cb0..200acbfe 100644 --- a/src/config.rs +++ b/src/config.rs @@ -73,7 +73,7 @@ fn deserialize_duration_ms<'a, D>(deserializer: D) -> ::std::result::Result<Dura match u64::deserialize(deserializer) { Ok(threshold_ms) => Ok(Duration::from_millis(threshold_ms)), Err(err) => { - error!("problem with config: {}; Using default value", err); + error!("Problem with config: {}; using default value", err); Ok(default_threshold_ms()) }, } @@ -171,7 +171,7 @@ fn deserialize_visual_bell_duration<'a, D>(deserializer: D) -> ::std::result::Re match u16::deserialize(deserializer) { Ok(duration) => Ok(duration), Err(err) => { - error!("problem with config: {}; Using default value", err); + error!("Problem with config: {}; using default value", err); Ok(0) }, } @@ -320,19 +320,19 @@ impl<'de> Deserialize<'de> for Decorations { "none" => Ok(Decorations::None), "full" => Ok(Decorations::Full), "true" => { - error!("deprecated decorations boolean value, \ + error!("Deprecated decorations boolean value, \ use one of transparent|buttonless|none|full instead; \ - Falling back to \"full\""); + falling back to \"full\""); Ok(Decorations::Full) }, "false" => { - error!("deprecated decorations boolean value, \ + error!("Deprecated decorations boolean value, \ use one of transparent|buttonless|none|full instead; \ - Falling back to \"none\""); + falling back to \"none\""); Ok(Decorations::None) }, _ => { - error!("invalid decorations value: {}; Using default value", value); + error!("Invalid decorations value: {}; using default value", value); Ok(Decorations::Full) } } @@ -346,23 +346,23 @@ impl<'de> Deserialize<'de> for Decorations { "none" => Ok(Decorations::None), "full" => Ok(Decorations::Full), "true" => { - error!("deprecated decorations boolean value, \ + error!("Deprecated decorations boolean value, \ use one of none|full instead; \ - Falling back to \"full\""); + falling back to \"full\""); Ok(Decorations::Full) }, "false" => { - error!("deprecated decorations boolean value, \ + error!("Deprecated decorations boolean value, \ use one of none|full instead; \ - Falling back to \"none\""); + falling back to \"none\""); Ok(Decorations::None) }, "transparent" | "buttonless" => { - error!("macos-only decorations value: {}; Using default value", value); + error!("macOS-only decorations value: {}; using default value", value); Ok(Decorations::Full) }, _ => { - error!("invalid decorations value: {}; Using default value", value); + error!("Invalid decorations value: {}; using default value", value); Ok(Decorations::Full) } } @@ -406,7 +406,7 @@ fn deserialize_padding<'a, D>(deserializer: D) -> ::std::result::Result<Delta<u8 match Delta::deserialize(deserializer) { Ok(delta) => Ok(delta), Err(err) => { - error!("problem with config: {}; Using default value", err); + error!("Problem with config: {}; using default value", err); Ok(default_padding()) }, } @@ -557,7 +557,7 @@ fn failure_default_vec<'a, D, T>(deserializer: D) -> ::std::result::Result<Vec<T let vec = match Vec::<serde_yaml::Value>::deserialize(deserializer) { Ok(vec) => vec, Err(err) => { - error!("problem with config: {}; Using empty vector", err); + error!("Problem with config: {}; using empty vector", err); return Ok(Vec::new()); }, }; @@ -568,7 +568,7 @@ fn failure_default_vec<'a, D, T>(deserializer: D) -> ::std::result::Result<Vec<T match T::deserialize(value) { Ok(binding) => bindings.push(binding), Err(err) => { - error!("problem with config: {}; Skipping value", err); + error!("Problem with config: {}; skipping value", err); }, } } @@ -586,7 +586,7 @@ fn deserialize_tabspaces<'a, D>(deserializer: D) -> ::std::result::Result<usize, match usize::deserialize(deserializer) { Ok(value) => Ok(value), Err(err) => { - error!("problem with config: {}; Using `8`", err); + error!("Problem with config: {}; using 8", err); Ok(default_tabspaces()) }, } @@ -598,7 +598,7 @@ fn default_true_bool<'a, D>(deserializer: D) -> ::std::result::Result<bool, D::E match bool::deserialize(deserializer) { Ok(value) => Ok(value), Err(err) => { - error!("problem with config: {}; Using `true`", err); + error!("Problem with config: {}; using true", err); Ok(true) }, } @@ -612,7 +612,7 @@ fn failure_default<'a, D, T>(deserializer: D) match T::deserialize(deserializer) { Ok(value) => Ok(value), Err(err) => { - error!("problem with config: {}; Using default value", err); + error!("Problem with config: {}; using default value", err); Ok(T::default()) }, } @@ -675,8 +675,8 @@ fn deserialize_scrolling_history<'a, D>(deserializer: D) -> ::std::result::Resul Ok(lines) => { if lines > MAX_SCROLLBACK_LINES { error!( - "problem with config: scrollback size is {}, but expected a maximum of {}; \ - Using {1} instead", + "Problem with config: scrollback size is {}, but expected a maximum of {}; \ + using {1} instead", lines, MAX_SCROLLBACK_LINES, ); Ok(MAX_SCROLLBACK_LINES) @@ -685,7 +685,7 @@ fn deserialize_scrolling_history<'a, D>(deserializer: D) -> ::std::result::Resul } }, Err(err) => { - error!("problem with config: {}; Using default value", err); + error!("Problem with config: {}; using default value", err); Ok(default_scrolling_history()) }, } @@ -697,7 +697,7 @@ fn deserialize_scrolling_multiplier<'a, D>(deserializer: D) -> ::std::result::Re match u8::deserialize(deserializer) { Ok(lines) => Ok(lines), Err(err) => { - error!("problem with config: {}; Using default value", err); + error!("Problem with config: {}; using default value", err); Ok(default_scrolling_multiplier()) }, } @@ -739,7 +739,7 @@ impl<'a> de::Deserialize<'a> for ModsWrapper { "Shift" => res.shift = true, "Alt" | "Option" => res.alt = true, "Control" => res.ctrl = true, - _ => error!("unknown modifier {:?}", modifier), + _ => error!("Unknown modifier {:?}", modifier), } } @@ -862,7 +862,7 @@ impl<'a> de::Deserialize<'a> for ModeWrapper { "~AppCursor" => res.not_mode |= mode::TermMode::APP_CURSOR, "AppKeypad" => res.mode |= mode::TermMode::APP_KEYPAD, "~AppKeypad" => res.not_mode |= mode::TermMode::APP_KEYPAD, - _ => error!("unknown mode {:?}", modifier), + _ => error!("Unknown mode {:?}", modifier), } } @@ -1045,7 +1045,7 @@ impl<'a> de::Deserialize<'a> for RawBinding { let scancode = val.as_u64().unwrap(); if scancode > u64::from(::std::u32::MAX) { return Err(<V::Error as Error>::custom(format!( - "invalid key binding, scancode too big: {}", + "Invalid key binding, scancode too big: {}", scancode ))); } @@ -1225,9 +1225,9 @@ fn deserialize_color_index<'a, D>(deserializer: D) -> ::std::result::Result<u8, Ok(index) => { if index < 16 { error!( - "problem with config: indexed_color's index is '{}', \ + "Problem with config: indexed_color's index is {}, \ but a value bigger than 15 was expected; \ - Ignoring setting", + ignoring setting", index ); @@ -1238,7 +1238,7 @@ fn deserialize_color_index<'a, D>(deserializer: D) -> ::std::result::Result<u8, } }, Err(err) => { - error!("problem with config: {}; Ignoring setting", err); + error!("Problem with config: {}; ignoring setting", err); // Return value out of range to ignore this color Ok(0) @@ -1293,7 +1293,7 @@ fn deserialize_optional_color<'a, D>(deserializer: D) -> ::std::result::Result<O }, Ok(None) => Ok(None), Err(err) => { - error!("problem with config: {}; Using standard foreground color", err); + error!("Problem with config: {}; using standard foreground color", err); Ok(None) }, } @@ -1375,14 +1375,14 @@ fn rgb_from_hex<'a, D>(deserializer: D) -> ::std::result::Result<Rgb, D::Error> type Value = Rgb; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str("Hex colors spec like 'ffaabb'") + f.write_str("hex color like 0xff00ff") } fn visit_str<E>(self, value: &str) -> ::std::result::Result<Rgb, E> where E: ::serde::de::Error { Rgb::from_str(&value[..]) - .map_err(|_| E::custom("failed to parse rgb; expect 0xrrggbb")) + .map_err(|_| E::custom("failed to parse rgb; expected hex color like 0xff00ff")) } } @@ -1392,7 +1392,7 @@ fn rgb_from_hex<'a, D>(deserializer: D) -> ::std::result::Result<Rgb, D::Error> match rgb { Ok(rgb) => Ok(rgb), Err(err) => { - error!("problem with config: {}; Using color #ff00ff", err); + error!("Problem with config: {}; using color #ff00ff", err); Ok(Rgb { r: 255, g: 0, b: 255 }) }, } @@ -1444,8 +1444,8 @@ impl ::std::error::Error for Error { fn description(&self) -> &str { match *self { - Error::NotFound => "could not locate config file", - Error::Empty => "empty config file", + Error::NotFound => "Couldn't locate config file", + Error::Empty => "Empty config file", Error::ReadingEnvHome(ref err) => err.description(), Error::Io(ref err) => err.description(), Error::Yaml(ref err) => err.description(), @@ -1458,10 +1458,10 @@ impl ::std::fmt::Display for Error { match *self { Error::NotFound | Error::Empty => write!(f, "{}", ::std::error::Error::description(self)), Error::ReadingEnvHome(ref err) => { - write!(f, "could not read $HOME environment variable: {}", err) + write!(f, "Couldn't read $HOME environment variable: {}", err) }, - Error::Io(ref err) => write!(f, "error reading config file: {}", err), - Error::Yaml(ref err) => write!(f, "problem with config: {}", err), + Error::Io(ref err) => write!(f, "Error reading config file: {}", err), + Error::Yaml(ref err) => write!(f, "Problem with config: {}", err), } } } @@ -1538,7 +1538,7 @@ impl Config { if let Some(old_path) = old.as_ref().filter(|old| old.exists()) { warn!( - "Found configuration at: '{}'. The file should be moved to the new location: '{}'.", + "Found configuration at: {}; this file should be moved to the new location: {}", old_path.to_string_lossy(), new.as_ref().map(|new| new.to_string_lossy()).unwrap(), ); @@ -1564,7 +1564,7 @@ impl Config { pub fn write_defaults() -> io::Result<Cow<'static, Path>> { let mut path = dirs::config_dir() .ok_or_else(|| { - io::Error::new(io::ErrorKind::NotFound, "could not find profile directory") + io::Error::new(io::ErrorKind::NotFound, "Couldn't find profile directory") } )?; @@ -1765,21 +1765,22 @@ impl Config { fn print_deprecation_warnings(&mut self) { if self.dimensions.is_some() { - warn!("{}", "Config `dimensions` is deprecated. \ - Please use `window.dimensions` instead."); + warn!("Config dimensions is deprecated; \ + please use window.dimensions instead"); } if self.padding.is_some() { - warn!("{}", "Config `padding` is deprecated. Please use `window.padding` instead."); + warn!("Config padding is deprecated; \ + please use window.padding instead"); } if self.mouse.faux_scrollback_lines.is_some() { - warn!("{}", "Config `mouse.faux_scrollback_lines` is deprecated. \ - Please use `mouse.faux_scrolling_lines` instead."); + warn!("Config mouse.faux_scrollback_lines is deprecated; \ + please use mouse.faux_scrolling_lines instead"); } if let Some(custom_cursor_colors) = self.custom_cursor_colors { - warn!("{}", "Config `custom_cursor_colors` is deprecated."); + warn!("Config custom_cursor_colors is deprecated"); if !custom_cursor_colors { self.colors.cursor.cursor = None; @@ -1788,17 +1789,18 @@ impl Config { } if self.cursor_style.is_some() { - warn!("{}", "Config `cursor_style` is deprecated. Please use `cursor.style` instead."); + warn!("Config cursor_style is deprecated; \ + please use cursor.style instead"); } if self.hide_cursor_when_typing.is_some() { - warn!("{}", "Config `hide_cursor_when_typing` is deprecated. \ - Please use `mouse.hide_when_typing` instead."); + warn!("Config hide_cursor_when_typing is deprecated; \ + please use mouse.hide_when_typing instead"); } if self.unfocused_hollow_cursor.is_some() { - warn!("{}", "Config `unfocused_hollow_cursor` is deprecated. \ - Please use `cursor.unfocused_hollow` instead."); + warn!("Config unfocused_hollow_cursor is deprecated; \ + please use cursor.unfocused_hollow instead"); } } } @@ -1899,7 +1901,7 @@ impl DeserializeSize for Size { match size { Ok(size) => Ok(size), Err(err) => { - error!("problem with config: {}; Using size 12", err); + error!("Problem with config: {}; using size 12", err); Ok(Size::new(12.)) }, } @@ -1949,7 +1951,7 @@ where { // This is necessary in order to get serde to complete deserialization of the configuration let _ignored = bool::deserialize(deserializer); - error!("The `scale_with_dpi` setting has been removed, \ + error!("The scale_with_dpi setting has been removed, \ on X11 the WINIT_HIDPI_FACTOR environment variable can be used instead."); Ok(None) } diff --git a/src/display.rs b/src/display.rs index b1575c58..d5a8978b 100644 --- a/src/display.rs +++ b/src/display.rs @@ -144,7 +144,7 @@ impl Display { let mut window = Window::new(&options, config.window())?; let dpr = window.hidpi_factor(); - info!("device_pixel_ratio: {}", dpr); + info!("Device pixel ratio: {}", dpr); // get window properties for initializing the other subsystems let mut viewport_size = window.inner_size_pixels() @@ -241,15 +241,16 @@ impl Display { // Initialize glyph cache let glyph_cache = { - info!("Initializing glyph cache"); + info!("Initializing glyph cache..."); let init_start = ::std::time::Instant::now(); let cache = renderer.with_loader(|mut api| GlyphCache::new(rasterizer, &font, &mut api))?; let stop = init_start.elapsed(); - let stop_f = stop.as_secs() as f64 + f64::from(stop.subsec_nanos()) / 1_000_000_000f64; - info!("Finished initializing glyph cache in {}", stop_f); + let stop_f = stop.as_secs() as f64 + + f64::from(stop.subsec_nanos()) / 1_000_000_000f64; + info!("... finished initializing glyph cache in {}s", stop_f); cache }; diff --git a/src/event_loop.rs b/src/event_loop.rs index 20ce3ae6..748e2bde 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -385,10 +385,10 @@ impl<T> EventLoop<T> if let Err(err) = self.pty_read(&mut state, &mut buf, pipe.as_mut()) { error!( - "Event loop exitting due to error: {} [{}:{}]", - err, + "[{}:{}] Event loop exiting due to error: {}", file!(), - line!() + line!(), + err ); break 'event_loop; } @@ -401,10 +401,10 @@ impl<T> EventLoop<T> if event.readiness().is_writable() { if let Err(err) = self.pty_write(&mut state) { error!( - "Event loop exitting due to error: {} [{}:{}]", - err, + "[{}:{}] Event loop exiting due to error: {}", file!(), - line!() + line!(), + err ); break 'event_loop; } diff --git a/src/grid/tests.rs b/src/grid/tests.rs index 2e06c10e..560bb0fe 100644 --- a/src/grid/tests.rs +++ b/src/grid/tests.rs @@ -84,8 +84,6 @@ fn scroll_down() { // Test that GridIterator works #[test] fn test_iter() { - info!(""); - let mut grid = Grid::new(Line(5), Column(5), 0, 0); for i in 0..5 { for j in 0..5 { @@ -93,8 +91,6 @@ fn test_iter() { } } - info!("grid: {:?}", grid); - let mut iter = grid.iter_from(Point { line: 4, col: Column(0), diff --git a/src/input.rs b/src/input.rs index 8b3bcbed..45956794 100644 --- a/src/input.rs +++ b/src/input.rs @@ -224,7 +224,7 @@ impl Action { .and_then(|clipboard| clipboard.load_primary() ) .map(|contents| |