aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/logging.rs
Commit message (Collapse)AuthorAge
* Replace serde's derive with custom proc macroChristian Duerr2020-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the existing `Deserialize` derive from serde with a `ConfigDeserialize` derive. The goal of this new proc macro is to allow a more error-friendly deserialization for the Alacritty configuration file without having to manage a lot of boilerplate code inside the configuration modules. The first part of the derive macro is for struct deserialization. This takes structs which have `Default` implemented and will only replace fields which can be successfully deserialized. Otherwise the `log` crate is used for printing errors. Since this deserialization takes the default value from the struct instead of the value, it removes the necessity for creating new types just to implement `Default` on them for deserialization. Additionally, the struct deserialization also checks for `Option` values and makes sure that explicitly specifying `none` as text literal is allowed for all options. The other part of the derive macro is responsible for deserializing enums. While only enums with Unit variants are supported, it will automatically implement a deserializer for these enums which accepts any form of capitalization. Since this custom derive prevents us from using serde's attributes on fields, some of the attributes have been reimplemented for `ConfigDeserialize`. These include `#[config(flatten)]`, `#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute is currently limited to at most one per struct. Additionally the `#[config(deprecated = "optional message")]` attribute allows easily defining uniform deprecation messages for fields on structs.
* Print multiline logs in one write callKirill Chibisov2020-12-10
| | | | Fixes potential split of multiline logs in the multithreaded context by writing them all at once.
* Fix stdout log message orderKirill Chibisov2020-11-19
| | | | | | | | | This patch makes sure that the message for the creation of a log file is always the first entry, before any other log file messages. Since we initialize our log file dynamically, the message is printed as soon as something is written to it. By making sure that we always write to a file first and then try stdout, we can ensure that the log file is always initialized before ever writing log messages to stdout.
* Add logging for crossfontChristian Duerr2020-08-14
| | | | This refactors the logging function to clean things up a little bit and also adds the ability to see log messages for the `crossfont` library.
* Use yellow/red from the config for message bar colorsKirill Chibisov2020-08-13
| | | | | | | | | | | | This commit completes the effort to use config colors for message bar content by picking red/yellow from user's colors.normal.{red,yellow} for error/warning messages instead of fixed colors. It also removes alacritty_terminal::term::color::RED and alacritty_terminal::term::color::YELLOW from the alacritty_terminal API, bumping its version to 0.11.0-dev. Fixes #4116.
* Remove gui dependencies from alacritty_terminalKirill Chibisov2020-07-11
| | | | | | | | This commit removes font dependency from alacritty_terminal, so it'll simplify the usage of alacritty_terminal as a library, since you won't link to system's libraries anymore. It also moves many alacritty related config options from it. Fixes #3393.
* Add automatic scrolling during selectionChristian Duerr2020-06-18
| | | | | | | | | | | | | This adds a new `Scheduler` which allows for staging events to be processed at a later time. If there is a selection active and the mouse is above or below the window, the viewport will now scroll torwards the direction of the mouse. The amount of lines scrolled depends on the distance of the mouse to the boundaries used for selection scrolling. To make it possible to scroll while in fullscreen, the selection scrolling area includes the padding of the window and is at least 5 pixels high in case there is not enough padding present.
* Remove copyright notice from filesChristian Duerr2020-06-06
| | | | | | | | | | | | | | Keeping the license as part of every file bloats up the files unnecessarily and introduces an additional overhead to the creation of new modules. Since cargo already provides excellent dependency management, most of the code-reuse of Alacritty should occur through Rust's dependency management instead of copying it source. If code is copied partially, copying the license from the main license file should be just as easy as copying from the top of the file and making some adjustments based on where it is used is likely necessary anyways.
* Remove env_logger depedencyChristian Duerr2020-05-29
| | | | | The env logger has been broken for over a year and is not used by anyone as far as I know. This removes this option entirely in favor of Alacritty's built-in logger level selection flags.
* Extend style guideline documentationChristian Duerr2020-05-05
|
* Add seconds and nanoseconds to log outputChristian Duerr2020-02-14
|
* Revert "Fix backspace deleting chars when IME is open"Christian Duerr2020-02-10
| | | | | | | | | | | This reverts commit 7f4dce2ee04859fb0b48f15cf808b60065778703. Originally it was assumed that macOS always sends the \x7f on backspace anyways, however this is not true. It seems like the character on backspace can change even within the same terminal session, so we need to have our own binding to reliably set the correct binding. A solution for #1606 should be implemented in cooperation with winit.
* Add support for alternate scroll escapeAleksey Kuznetsov2019-10-15
| | | | Fixes #2727.
* Fix logged config path separators on WindowsKirill Chibisov2019-10-14
| | | | | | It was discovered that we were logging path with `\\` instead of `\` as separators on Windows due to use of Debug formatting instead of Display for paths.
* Update to winit/glutin EventLoop 2.0Christian Duerr2019-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | This takes the latest glutin master to port Alacritty to the EventLoop 2.0 rework. This changes a big part of the event loop handling by pushing the event loop in a separate thread from the renderer and running both in parallel. Fixes #2796. Fixes #2694. Fixes #2643. Fixes #2625. Fixes #2618. Fixes #2601. Fixes #2564. Fixes #2456. Fixes #2438. Fixes #2334. Fixes #2254. Fixes #2217. Fixes #1789. Fixes #1750. Fixes #1125.
* Refactor config parsing filesChristian Duerr2019-05-10
| | | | | | | | This is a large refactor of the config parsing structure, attempting to reduce the size of the file a bit by splitting it up into different modules with more specific purposes. This also fixes #2279.
* Add git hash to version string, and fix crate name (#2397)Nathan Lilienthal2019-05-03
| | | | This moves `cli` out of `alacritty_terminal` and into `alacritty` where it belongs, along with the `clap` dependency.
* Split alacritty into a separate cratesTheodore Dubois2019-04-28
The crate containing the entry point is called alacritty, and the crate containing everything else is called alacritty_terminal.