]>
Commit | Line | Data |
---|---|---|
de8ee011 A |
1 | /* Copyright © 2018 Apple Inc. All rights reserved. |
2 | * | |
3 | * lf_hfs_logger.h | |
4 | * livefiles_hfs | |
5 | * | |
6 | * Created by Yakov Ben Zaken on 20/03/2018. | |
7 | */ | |
8 | ||
9 | #ifndef lf_hfs_logger_h | |
10 | #define lf_hfs_logger_h | |
11 | ||
12 | #include <os/log.h> | |
13 | ||
14 | typedef enum | |
15 | { | |
16 | LEVEL_DEBUG, | |
17 | LEVEL_DEFAULT, | |
18 | LEVEL_ERROR, | |
19 | LEVEL_AMOUNT, | |
20 | ||
21 | } HFSLogLevel_e; | |
22 | ||
23 | extern os_log_t gpsHFSLog; | |
24 | extern const os_log_type_t gpeHFSToOsLevel[ LEVEL_AMOUNT ]; | |
25 | extern bool gbIsLoggerInit; | |
26 | ||
27 | ||
28 | #define LFHFS_LOG( _level, ... ) \ | |
29 | do { \ | |
30 | if ( gbIsLoggerInit ) \ | |
31 | { \ | |
32 | os_log_with_type((gpsHFSLog), gpeHFSToOsLevel[_level], ##__VA_ARGS__); \ | |
33 | } \ | |
34 | } while(0) | |
35 | ||
36 | int LFHFS_LoggerInit( void ); | |
37 | ||
38 | #endif /* lf_hfs_logger_h */ |