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
/// Enhanced location macro with support for custom messages
///
/// Output format: `file_path:line:column[: custom_message]`
///
/// # Features
/// - No arguments: Returns basic location info (`file:line:column`)
/// - Single argument: Location + custom message
/// - Multiple arguments: Location + formatted message (supports `format!` syntax)
///
/// # Return Type
/// - No arguments: `&'static str` (compile-time static string)
/// - With arguments: `String` (runtime-generated dynamic string)
///
/// # Examples
///
/// ## Basic usage
/// ```rust
/// println!("Location: {}", here!());
/// // Example output: src/main.rs:42:10
/// ```
///
/// ## With static message
/// ```rust
/// println!("Error: {}", here!("Something went wrong"));
/// // Example output: src/main.rs:42:10: Something went wrong
///
/// // Trailing comma supported
/// println!("Error: {}", here!("Something went wrong",));
/// ```
///
/// ## Dynamic formatted message
/// ```rust
/// let line_num = 100;
/// println!("Warning: {}", here!("Check line {}", line_num));
/// // Example output: src/main.rs:42:10: Check line 100
///
/// // Complex formatting
/// println!("Error: {}", here!("User {} not found, status: {}", "Alice", 404));
/// ```