Android development of the widevine CDM has been done on the jb-mr2 branch of the cdm code base. This CL contains a merge of that jb-mr2 work to CDM master, and also reflects the evolution of the common Modular DRM code base since jb-mr2 branched. Change-Id: I1d7e1a12d092c00044a4298261146cb97808d4ef
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
//
|
|
// Log - Platform independent interface for a Logging class
|
|
//
|
|
#ifndef CDM_BASE_LOG_H_
|
|
#define CDM_BASE_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;
|
|
|
|
// Required to enable/disable verbose logging (LOGV) in Chromium. In Chromium,
|
|
// verbose logging level is controlled using command line switches --v (global)
|
|
// or --vmodule (per module). This function calls logging::InitLogging to
|
|
// initialize logging, which should have already been included in most Chromium
|
|
// based binaries. However, it is typically not included by default in
|
|
// unittests, in particular, the unittests in CDM core need to call InitLogging
|
|
// to be able to control verbose logging in command line.
|
|
void InitLogging(int argc, const char* const* argv);
|
|
|
|
void Log(const char* file, int line, LogPriority level, const char* fmt, ...);
|
|
|
|
// Log APIs
|
|
#define LOGE(...) Log(__FILE__, __LINE__, wvcdm::LOG_ERROR, __VA_ARGS__)
|
|
#define LOGW(...) Log(__FILE__, __LINE__, wvcdm::LOG_WARN, __VA_ARGS__)
|
|
#define LOGI(...) Log(__FILE__, __LINE__, wvcdm::LOG_INFO, __VA_ARGS__)
|
|
#define LOGD(...) Log(__FILE__, __LINE__, wvcdm::LOG_DEBUG, __VA_ARGS__)
|
|
#define LOGV(...) Log(__FILE__, __LINE__, wvcdm::LOG_VERBOSE, __VA_ARGS__)
|
|
|
|
}; // namespace wvcdm
|
|
|
|
#endif // CDM_BASE_LOG_H_
|