aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLibravatar Alina Hagan <alina-hagan@outlook.com>2024-08-09 23:33:25 +0100
committerLibravatar Alina Hagan <alina-hagan@outlook.com>2024-08-09 23:33:25 +0100
commit4a1625a311b9b2355a82ce3a595c2c4466ed7fcf (patch)
tree06196d6ecb2b711625158345513c70b27e10ae3b /src/error.rs
parent65282048aefecda06f937ed670755b64b19ce9b1 (diff)
added option to log messages to tracing over stdout
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs3
1 files changed, 3 insertions, 0 deletions
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(),
}