Commit Graph

12 Commits

Author SHA1 Message Date
Christian Duerr 57a455e5f2
Ignore errors when logger can't write to output
The (e)print macro will panic when there is no output available to
write to, however in our scenario where we only log user errors to
stderr, the better choice would be to ignore when writing to stdout or
stderr is not possible.

This changes the (e)print macro to make use of `write` and ignore
any potential errors.

Since (e)println rely on (e)print, this also solves potential failuers
when calling (e)println.

With this change implemented, all of logging, (e)println and (e)print
should never fail even if the stdout/stderr is not available.
2018-07-25 21:05:49 +00:00
Christian Duerr 5ba34d4f97
Move to cargo clippy
Using clippy as a library has been deprecated, instead the `cargo
clippy` command should be used instead. To comply with this change
clippy has been removed from the `Cargo.toml` and is now installed with
cargo when building in CI.

This has also lead to a few new clippy issues to show up, this includes
everything in the `font` subdirectory. This has been fixed and `font`
should now be covered by clippy CI too.

This also upgrades all dependencies, as a result this fixes #1341 and
this fixes #1344.
2018-06-17 09:19:30 +00:00
Harlan Lieberman-Berg 0edac74e61 Explicitly call log::set_max_level (Closes: #1201)
For some reason, log 0.4 requires that we explicitly set the log level
with log::set_max_level or it defaults to Off.  The documentation
isn't clear but suggests we must do this in addition to doing the
filtration ourselves in the Log impl.
2018-03-22 18:10:27 -07:00
Christian Duerr 7f2b398ad2
Remove all instances of unwrap() from config
Unwrapping inside the config file parsing can lead to some issues that
prevent us from falling back to a default configuration file.

One instance of that issue was mentioned in #1135.

Now all instances of `unwrap()` have been removed and replaced with
proper error handling. This will make the config more robust and
prevents live reload from silently breaking while alacritty is running.

This also fixes a few currently existing clippy issues.
Clippy added an additonal lint which complains about `MyStruct { field:
field }`.

These issues have been fixed, except for some false-positives and issues
in external macros which will probably be fixed with future updates (rust-lang-nursery/bitflags#149)
2018-03-04 22:40:15 +00:00
golem131 b82622e994 Update dependencies
Updated the version of some dependencies.

This also changes to a new clippy version so clippy can work with the latest nightly compiler again. Some issues created by new lints have been fixed.
2018-01-26 20:20:42 +00:00
Christian Duerr 2920cbe710
Add clippy check to travis
This commit adds clippy as a required step of the build process. To make
this possible, all existing clippy issues have been resolved.
2018-01-06 01:42:55 +00:00
Joe Wilm 619e877819 Add support for env_logger
When RUST_LOG environment variable is set, uses env_logger instead of
our custom logger. This is desirable for debugging purposes.
2017-10-08 22:20:58 -07:00
Aaron Hill 5f7885749c Use clippy = "*", update, and fix some warnings (#796)
Because there are so many clippy warnings in the current codebase,
this commit removes '#![cfg_attr(feature = "clippy", deny(clippy))]',
to make it easier to fix warnings incrementally.
2017-09-27 17:29:44 -07:00
Joe Wilm ee37dc86ab Return an error from logging::initialize
Logging initialization now shares the same error handling code as the
rest of the `run` function.
2017-01-23 09:14:01 -08:00
Joe Wilm abd3958cb5 Minor formatting fixes 2017-01-23 09:14:01 -08:00
Joe Wilm db5f65637a Changes to Logger logic
The logger implementation will now only show items from Alacritty.
Additionally, the module info is omitted from the log output. If the
origin of a log item must be found, it can easily be grepped for.
2017-01-23 09:14:01 -08:00
Lukas Lueg 64b42cd2f3 Use the log-crate instead of printing to stdout 2017-01-23 09:14:01 -08:00