diff options
| author | Fuwn <[email protected]> | 2020-10-26 19:03:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-10-26 19:03:53 -0700 |
| commit | 9742614a1dc4699c1f2c69d923d402237672335d (patch) | |
| tree | a49f7d834372f37cef06b30a28ff1b40bdfaa079 /src/macros.rs | |
| parent | Create README.md (diff) | |
| download | dep-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.rs | 19 |
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() }; +} |