Skip to content

Commit de7cc8d

Browse files
committed
Pass module as %s arg instead of concatenation
1 parent d43a05f commit de7cc8d

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Lilu Changelog
44
- Made applyLookupPatch support kernel patches by passsing null kext
55
- Export hde64 interface
66
- Added evector deleter without copying for improved performance
7+
- Allow C strings as module prefix argument to the logging functions
78

89
#### v1.4.0
910
- Fixed mishandling user patches process list after processKernel API call

Lilu/Headers/kern_util.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ extern proc_t kernproc;
7373
* @param cond precondition
7474
* @param str printf-like string
7575
*/
76-
#define SYSLOG_COND(cond, module, str, ...) \
77-
do { \
78-
if (cond) \
79-
lilu_os_log( "%s%10s" str "\n", xStringify(PRODUCT_NAME) ": ", module " @ ", ## __VA_ARGS__); \
76+
#define SYSLOG_COND(cond, module, str, ...) \
77+
do { \
78+
if (cond) \
79+
lilu_os_log( "%s%10s: @ " str "\n", xStringify(PRODUCT_NAME), safeString(module), ## __VA_ARGS__); \
8080
} while (0)
8181

8282
/**
@@ -94,12 +94,12 @@ extern proc_t kernproc;
9494
* @param module log module
9595
* @param str printf-like string
9696
*/
97-
#define SYSTRACE_COND(cond, module, str, ...) \
98-
do { \
99-
if (cond) { \
100-
SYSLOG(module, str, ## __VA_ARGS__); \
101-
OSReportWithBacktrace( "%s%10s" str "\n", xStringify(PRODUCT_NAME) ": ", module " @ ", ## __VA_ARGS__); \
102-
} \
97+
#define SYSTRACE_COND(cond, module, str, ...) \
98+
do { \
99+
if (cond) { \
100+
SYSLOG(module, str, ## __VA_ARGS__); \
101+
OSReportWithBacktrace( "%s%10s: @ " str "\n", xStringify(PRODUCT_NAME), safeString(module), ## __VA_ARGS__); \
102+
} \
103103
} while (0)
104104

105105
/**
@@ -117,12 +117,12 @@ extern proc_t kernproc;
117117
* @param module log module
118118
* @param str printf-like string
119119
*/
120-
#define PANIC_COND(cond, module, str, ...) \
121-
do { \
122-
if (cond) { \
123-
(panic)( "%s%10s" str "\n", xStringify(PRODUCT_NAME) ": ", module " @ ", ## __VA_ARGS__); \
124-
UNREACHABLE(); \
125-
} \
120+
#define PANIC_COND(cond, module, str, ...) \
121+
do { \
122+
if (cond) { \
123+
(panic)( "%s%10s: @ " str "\n", xStringify(PRODUCT_NAME), safeString(module), ## __VA_ARGS__); \
124+
UNREACHABLE(); \
125+
} \
126126
} while (0)
127127

128128
/**

0 commit comments

Comments
 (0)