diff options
author | Drew Richardson <drew.richardson@arm.com> | 2015-03-28 12:00:00 -0700 |
---|---|---|
committer | Drew Richardson <drew.richardson@arm.com> | 2015-04-01 14:41:00 -0700 |
commit | abc3535c0d237bf7968b7092e545f2ff422af954 (patch) | |
tree | 778f83b3d8fd576762290b58b12c33cca5a193e1 /daemon/Logging.h | |
parent | e8f6a181be0b67fc9d9ac117bc2ed01737be654c (diff) |
gator: Version 5.215.21
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/Logging.h')
-rw-r--r-- | daemon/Logging.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/daemon/Logging.h b/daemon/Logging.h index 09e93ff..a7b4523 100644 --- a/daemon/Logging.h +++ b/daemon/Logging.h @@ -1,5 +1,5 @@ /** - * Copyright (C) ARM Limited 2010-2014. All rights reserved. + * Copyright (C) ARM Limited 2010-2015. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -17,10 +17,14 @@ class Logging { public: Logging(bool debug); ~Logging(); - void logError(const char* file, int line, const char* fmt, ...); - void logMessage(const char* fmt, ...); - char* getLastError() {return mErrBuf;} - char* getLastMessage() {return mLogBuf;} +#define logError(...) _logError(__func__, __FILE__, __LINE__, __VA_ARGS__) + __attribute__ ((format (printf, 5, 6))) + void _logError(const char *function, const char *file, int line, const char *fmt, ...); +#define logMessage(...) _logMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) + __attribute__ ((format (printf, 5, 6))) + void _logMessage(const char *function, const char *file, int line, const char *fmt, ...); + char *getLastError() {return mErrBuf;} + char *getLastMessage() {return mLogBuf;} private: char mErrBuf[4096]; // Arbitrarily large buffer to hold a string @@ -29,7 +33,7 @@ private: pthread_mutex_t mLoggingMutex; }; -extern Logging* logg; +extern Logging *logg; extern void handleException() __attribute__ ((noreturn)); |