diff options
author | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-24 17:16:17 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-24 17:16:17 +0200 |
commit | 6e1ff8e78958e5ea6871dca4a5ef6076fadcbcc1 (patch) | |
tree | 4e17c48118edbe073b49341d95809a8e0b2a8f80 /tools/gator/daemon/Logging.h | |
parent | ed6e65a66f3bcf84dff4ff4e680096b7e40076d5 (diff) | |
parent | 09f333ed6069575a71fabc999c4dc39b6594d727 (diff) |
Merge remote-tracking branch 'armlt/3.3-armlt-gator-5.10' into stable-linux-ux500-3.3ubuntu-release-12-07ubuntu-release-12-06
Conflicts:
drivers/Kconfig
Diffstat (limited to 'tools/gator/daemon/Logging.h')
-rwxr-xr-x | tools/gator/daemon/Logging.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/gator/daemon/Logging.h b/tools/gator/daemon/Logging.h new file mode 100755 index 00000000000..424796658f7 --- /dev/null +++ b/tools/gator/daemon/Logging.h @@ -0,0 +1,45 @@ +/** + * Copyright (C) ARM Limited 2010-2012. 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 + * published by the Free Software Foundation. + */ + +#ifndef __LOGGING_H__ +#define __LOGGING_H__ + +#include <stdio.h> +#include <string.h> +#include <limits.h> +#ifdef WIN32 +#include <windows.h> +#else +#include <pthread.h> +#endif + +#define DRIVER_ERROR "\n Driver issue:\n >> gator.ko must be built against the current kernel version & configuration\n >> gator.ko should be co-located with gatord in the same directory\n >> OR insmod gator.ko prior to launching gatord" + +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;} + +private: + char mErrBuf[4096]; // Arbitrarily large buffer to hold a string + char mLogBuf[4096]; // Arbitrarily large buffer to hold a string + bool mDebug; +#ifdef WIN32 + HANDLE mLoggingMutex; +#else + pthread_mutex_t mLoggingMutex; +#endif +}; + +extern Logging* logg; + +#endif //__LOGGING_H__ |