log.h (honggfuzz-2.4) | : | log.h (honggfuzz-2.5) | ||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | |||
* limitations under the License. | * limitations under the License. | |||
* | * | |||
*/ | */ | |||
#ifndef _HF_COMMON_LOG_H_ | #ifndef _HF_COMMON_LOG_H_ | |||
#define _HF_COMMON_LOG_H_ | #define _HF_COMMON_LOG_H_ | |||
#include <pthread.h> | #include <pthread.h> | |||
#include <stdarg.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#ifdef _HF_ARCH_DARWIN | ||||
#pragma push_macro("DEBUG") | ||||
#undef DEBUG | ||||
#endif | ||||
enum llevel_t { FATAL = 0, ERROR, WARNING, INFO, DEBUG, HELP, HELP_BOLD }; | enum llevel_t { FATAL = 0, ERROR, WARNING, INFO, DEBUG, HELP, HELP_BOLD }; | |||
extern enum llevel_t hf_log_level; | extern enum llevel_t hf_log_level; | |||
#define LOG_HELP(...) logLog(HELP, __FUNCTION__, __LINE__, false, __VA_ARGS __); | #define LOG_HELP(...) logLog(HELP, __FUNCTION__, __LINE__, false, __VA_ARGS __); | |||
#define LOG_HELP_BOLD(...) logLog(HELP_BOLD, __FUNCTION__, __LINE__, false, __VA _ARGS__); | #define LOG_HELP_BOLD(...) logLog(HELP_BOLD, __FUNCTION__, __LINE__, false, __VA _ARGS__); | |||
#define LOG_D(...) \ | #define LOG_D(...) \ | |||
if (hf_log_level >= DEBUG) { \ | if (hf_log_level >= DEBUG) { \ | |||
logLog(DEBUG, __FUNCTION__, __LINE__, false, __VA_ARGS__); \ | logLog(DEBUG, __FUNCTION__, __LINE__, false, __VA_ARGS__); \ | |||
skipping to change at line 95 | skipping to change at line 101 | |||
extern void logRedirectLogFD(int fd); | extern void logRedirectLogFD(int fd); | |||
extern int logFd(void); | extern int logFd(void); | |||
extern enum llevel_t logGetLevel(void); | extern enum llevel_t logGetLevel(void); | |||
extern pthread_mutex_t* logMutexGet(void); | extern pthread_mutex_t* logMutexGet(void); | |||
void logMutexReset(void); | void logMutexReset(void); | |||
#if defined(__sun) | ||||
void dprintf(int fd, const char*, ...); | ||||
int vdprintf(int fd, const char*, va_list); | ||||
#endif | ||||
#ifdef _HF_ARCH_DARWIN | ||||
#pragma pop_macro("DEBUG") | ||||
#endif | ||||
#endif /* ifndef _HF_COMMON_LOG_H_ */ | #endif /* ifndef _HF_COMMON_LOG_H_ */ | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 15 lines changed or added |