Merge from Widevine repo of http://go/wvgerrit/46204 Refactor utility code - split the mock, step 1 Merge from Widevine repo of http://go/wvgerrit/46205 Move some OEMCrypto types to common header - split the mock, step 2 Merge from Widevine repo of http://go/wvgerrit/46206 Split mock into two -- step 3 Merge from Widevine repo of http://go/wvgerrit/47460 Split the mock into two -- step 3.5 The CL moves several files used by oemcrypto and cdm into a common subdirectory, so that it may more easily be shared with partners. The CORE_DISALLOW_COPY_AND_ASSIGN macro was moved to its own header in the util/include directory. This CL removes some references to the mock from other code, and puts some constants and types, such as the definition of the keybox, into a header in oemcrypto. Test: tested as part of http://go/ag/4674759 bug: 76393338 Change-Id: I75b4bde7062ed8ee572c97ebc2f4da018f4be0c9
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
//
|
|
// Log - Platform independent interface for a Logging class
|
|
//
|
|
#ifndef WVCDM_UTIL_LOG_H_
|
|
#define WVCDM_UTIL_LOG_H_
|
|
|
|
namespace wvcdm {
|
|
|
|
// Simple logging class. The implementation is platform dependent.
|
|
|
|
typedef enum {
|
|
LOG_ERROR,
|
|
LOG_WARN,
|
|
LOG_INFO,
|
|
LOG_DEBUG,
|
|
LOG_VERBOSE
|
|
} LogPriority;
|
|
|
|
extern LogPriority g_cutoff;
|
|
|
|
// Enable/disable verbose logging (LOGV).
|
|
// This function is supplied for cases where the system layer does not
|
|
// initialize logging. This is also needed to initialize logging in
|
|
// unit tests.
|
|
void InitLogging();
|
|
|
|
void Log(const char* file, const char* function, int line, LogPriority level,
|
|
const char* fmt, ...);
|
|
|
|
// Log APIs
|
|
#ifndef LOGE
|
|
#define LOGE(...) Log(__FILE__, __func__, __LINE__, \
|
|
wvcdm::LOG_ERROR, __VA_ARGS__)
|
|
#define LOGW(...) Log(__FILE__, __func__, __LINE__, \
|
|
wvcdm::LOG_WARN, __VA_ARGS__)
|
|
#define LOGI(...) Log(__FILE__, __func__, __LINE__, \
|
|
wvcdm::LOG_INFO, __VA_ARGS__)
|
|
#define LOGD(...) Log(__FILE__, __func__, __LINE__, \
|
|
wvcdm::LOG_DEBUG, __VA_ARGS__)
|
|
#define LOGV(...) Log(__FILE__, __func__, __LINE__, \
|
|
wvcdm::LOG_VERBOSE, __VA_ARGS__)
|
|
#endif
|
|
} // namespace wvcdm
|
|
|
|
#endif // WVCDM_UTIL_LOG_H_
|