aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2020-10-26 19:03:53 -0700
committerFuwn <[email protected]>2020-10-26 19:03:53 -0700
commit9742614a1dc4699c1f2c69d923d402237672335d (patch)
treea49f7d834372f37cef06b30a28ff1b40bdfaa079 /src/macros.rs
parentCreate README.md (diff)
downloaddep-core-next-9742614a1dc4699c1f2c69d923d402237672335d.tar.xz
dep-core-next-9742614a1dc4699c1f2c69d923d402237672335d.zip
repo: push main from local to remote
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/macros.rs b/src/macros.rs
new file mode 100644
index 0000000..8b4d3af
--- /dev/null
+++ b/src/macros.rs
@@ -0,0 +1,19 @@
+#![macro_use]
+
+#[macro_export]
+macro_rules! check_error {
+ ($e:expr) => {
+ if let Err(err) = $e {
+ warn!("ERROR [{}:{}] {:?}", line!(), column!(), err);
+ }
+ };
+}
+
+macro_rules! failed {
+ ($e:expr) => { warn!("[{}:{}] {}", line!(), column!(), $e); };
+ ($e:expr, $w:expr) => { warn!("[{}:{}] {} | {}", line!(), column!(), $e, $w); };
+}
+
+macro_rules! now {
+ () => { Utc::now().format("%FT%T").to_string() };
+}