1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! Ergonomic `format!`-style macros for the most common log calls.
//!
//! These are thin wrappers over [`crate::log`]; the functions remain available
//! for composition and testing. They are re-exported both at the crate root and
//! from [`crate::log`], so call them as either `actions_rs::warning!(...)` or
//! `actions_rs::log::warning!(...)`.
/// `debug!("x = {x}")` → [`crate::log::debug()`] with `format!` arguments.
///
/// # Examples
///
/// ```
/// let key = "v2-linux";
/// actions_rs::debug!("cache key = {key}");
/// ```
/// `info!("...")` → [`crate::log::info()`] with `format!` arguments.
///
/// # Examples
///
/// ```
/// let n = 3;
/// actions_rs::info!("processed {n} files");
/// ```
/// `notice!("...")` → [`crate::log::notice()`] with `format!` arguments.
///
/// # Examples
///
/// ```
/// actions_rs::notice!("released v{}.{}", 1, 2);
/// ```
/// `warning!("...")` → [`crate::log::warning()`] with `format!` arguments.
///
/// # Examples
///
/// ```
/// let pct = 92;
/// actions_rs::warning!("disk {pct}% full");
/// ```
/// `error!("...")` → [`crate::log::error()`] with `format!` arguments.
///
/// # Examples
///
/// ```
/// let path = "Cargo.toml";
/// actions_rs::error!("{path}: missing `version` field");
/// ```
/// `group!("name", { ... })` runs the block inside a collapsible group that is
/// closed even on panic. Evaluates to the block's value.
///
/// # Examples
///
/// ```
/// let answer = actions_rs::group!("compute", { 6 * 7 });
/// assert_eq!(answer, 42);
/// ```
// `#[macro_export]` publishes the macros at the crate root (e.g.
// `actions_rs::group!`). These re-exports additionally give them a path inside
// this module (`crate::macros::group`, …) so they can be surfaced from
// [`crate::log`] next to the functions they wrap — `crate::macros::error`
// resolves to the macro alone, sidestepping the `crate::error` module.
pub use ;