Files
ce_cdm/cdm/include/stderr_logger.h
2025-04-02 10:27:18 -07:00

29 lines
781 B
C++

// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
//
// You can use this implementation of ILogger when calling Cdm::initialize() in
// order to log all messages to stderr. This preserves the behavior of past CE
// CDM releases.
#ifndef WVCDM_CDM_STDERR_LOGGER_H_
#define WVCDM_CDM_STDERR_LOGGER_H_
#include <iostream>
#include <string>
#include "cdm.h"
namespace CDM_NAMESPACE {
class StderrLogger : public Cdm::ILogger {
public:
StderrLogger() {}
~StderrLogger() override {}
void log(const std::string& message) override {
std::cerr << message << std::endl << std::flush;
}
};
} // namespace CDM_NAMESPACE
#endif // WVCDM_CDM_STDERR_LOGGER_H_