From 4a1625a311b9b2355a82ce3a595c2c4466ed7fcf Mon Sep 17 00:00:00 2001 From: Alina Hagan Date: Fri, 9 Aug 2024 23:33:25 +0100 Subject: added option to log messages to tracing over stdout --- src/error.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 33c6ff8..fdec096 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,11 +1,13 @@ use std::error::Error; use std::fmt; +use tracing::error; #[derive(Debug)] pub struct IllegalArgumentException(String); impl IllegalArgumentException { pub fn new(msg: &str) -> IllegalArgumentException { + error!(msg); IllegalArgumentException(msg.to_string()) } } @@ -29,6 +31,7 @@ pub struct IllegalStateException { impl IllegalStateException { pub fn new(msg: &str) -> IllegalStateException { + error!(msg); IllegalStateException { details: msg.to_string(), } -- cgit v1.2.3