From 5b6e06928bbd5466d0c65149e8c7e44871e71a8c Mon Sep 17 00:00:00 2001 From: Sakarias Johansson Date: Tue, 21 Mar 2023 23:09:15 +0100 Subject: =?UTF-8?q?=F0=9F=93=96=20Add=20logging=20and=20term=20writes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit println works for a while. Was time to set up something better. Worth to not that there is a big difference between logging and writing to the terminal which is why both slog and console was dragged in. Might seem similar but purpose is not the same. Most of the time the log is interesting during runtime but user messages does not belong in the log. --- racer-tracer/src/error.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'racer-tracer/src/error.rs') diff --git a/racer-tracer/src/error.rs b/racer-tracer/src/error.rs index b7cb46d..d9b13ab 100644 --- a/racer-tracer/src/error.rs +++ b/racer-tracer/src/error.rs @@ -46,6 +46,9 @@ pub enum TracerError { #[error("Key callback failed: {0}")] KeyError(String), + + #[error("Failed to create log: {0}")] + CreateLogError(String), } impl From for i32 { @@ -69,6 +72,7 @@ impl From for i32 { TracerError::SceneLoad(_) => 13, TracerError::ArgumentParsingError(_) => 14, TracerError::KeyError(_) => 15, + TracerError::CreateLogError(_) => 16, } } } -- cgit v1.2.3