[ Merge of http://go/wvgerrit/67923 ] Before, all symbols were being exported in the dynamic library. Now only the public symbols are. This no longer has the unit tests load the dynamic library, so we lose testing the dynamic integration; but the unit tests use a lot of internals, even the top-level CDM ones. Bug: 69271232 Bug: 69548115 Test: WV unit/integration tests Change-Id: I62919937277ec785aca1f8b36b28caa2f9d8f3ea
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine Master
|
|
// License Agreement.
|
|
//
|
|
// Log - Platform independent interface for a Logging class
|
|
//
|
|
#ifndef WVCDM_UTIL_LOG_H_
|
|
#define WVCDM_UTIL_LOG_H_
|
|
|
|
#include "util_common.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.
|
|
CORE_UTIL_EXPORT void InitLogging();
|
|
|
|
CORE_UTIL_EXPORT 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_
|