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 /src/renderer | |
parent | dfc30eeef5eb6df9f658e62875e5cde93173e37b (diff) | |
download | alacritty-04707cbba630e3e4ad6b4200bef8ae7888c49e3b.tar.gz alacritty-04707cbba630e3e4ad6b4200bef8ae7888c49e3b.zip |
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".
Diffstat (limited to 'src/renderer')
-rw-r--r-- | src/renderer/mod.rs | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 42a17486..4d5d8de3 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -321,7 +321,7 @@ impl GlyphCache { self.rasterizer.get_glyph(GlyphKey { font_key: regular, c: 'm', size: font.size() })?; let metrics = self.rasterizer.metrics(regular, size)?; - info!("Font size changed: {:?} [DPR: {}]", font.size, dpr); + info!("Font size changed to {:?} with DPR of {}", font.size, dpr); self.font_size = font.size; self.font_key = regular; @@ -816,26 +816,15 @@ impl QuadRenderer { } pub fn reload_shaders(&mut self, size: PhysicalSize) { - warn!("Reloading shaders ..."); + warn!("Reloading shaders..."); let result = (TextShaderProgram::new(size), RectShaderProgram::new()); let (program, rect_program) = match result { (Ok(program), Ok(rect_program)) => { - warn!(" ... OK"); + info!("... successfully reloaded shaders"); (program, rect_program) } (Err(err), _) | (_, Err(err)) => { - match err { - ShaderCreationError::Io(err) => { - error!("Error reading shader file: {}", err); - } - ShaderCreationError::Compile(path, log) => { - error!("Error compiling shader at {:?}\n{}", path, log); - } - ShaderCreationError::Link(log) => { - error!("Error reloading shaders: {}", log); - } - } - + error!("{}", err); return; } }; @@ -1234,7 +1223,7 @@ impl TextShaderProgram { ); let projection: [[f32; 4]; 4] = ortho.into(); - info!("width: {}, height: {}", width, height); + info!("Width: {}, Height: {}", width, height); unsafe { gl::UniformMatrix4fv( @@ -1483,11 +1472,15 @@ impl ::std::error::Error for ShaderCreationError { impl ::std::fmt::Display for ShaderCreationError { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { match *self { - ShaderCreationError::Io(ref err) => write!(f, "couldn't read shader: {}", err), - ShaderCreationError::Compile(ref _path, ref s) => { - write!(f, "failed compiling shader: {}", s) - } - ShaderCreationError::Link(ref s) => write!(f, "failed linking shader: {}", s), + ShaderCreationError::Io(ref err) => { + write!(f, "Couldn't read shader: {}", err) + }, + ShaderCreationError::Compile(ref path, ref log) => { + write!(f, "Failed compiling shader at {}: {}", path.display(), log) + }, + ShaderCreationError::Link(ref log) => { + write!(f, "Failed linking shader: {}", log) + }, } } } |