Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/media/webrtc/sdp/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  SdpLog.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "sdp/SdpLog.h"

#include <type_traits>

#include "common/browser_logging/CSFLog.h"

namespace mozilla {
LazyLogModule SdpLog("sdp");
}  // namespace mozilla

// For compile time enum comparison
template <typename E, typename F>
constexpr bool compareEnum(const E e, const F f) {
  return static_cast<typename std::underlying_type<E>::type>(e) ==
         static_cast<typename std::underlying_type<F>::type>(f);
}

CSFLogLevel SDPToCSFLogLevel(const SDPLogLevel priority) {
  static_assert(compareEnum(SDP_LOG_ERROR, CSF_LOG_ERROR));
  static_assert(compareEnum(SDP_LOG_WARNING, CSF_LOG_WARNING));
  static_assert(compareEnum(SDP_LOG_INFO, CSF_LOG_INFO));
  static_assert(compareEnum(SDP_LOG_DEBUG, CSF_LOG_DEBUG));
  static_assert(compareEnum(SDP_LOG_VERBOSE, CSF_LOG_VERBOSE));

  // Check that all SDP_LOG_* cases are covered. It compiles to nothing.
  switch (priority) {
    case SDP_LOG_ERROR:
    case SDP_LOG_WARNING:
    case SDP_LOG_INFO:
    case SDP_LOG_DEBUG:
    case SDP_LOG_VERBOSE:
      break;
  }

  // Ditto for CSF_LOG_*
  switch (static_cast<CSFLogLevel>(priority)) {
    case CSF_LOG_ERROR:
    case CSF_LOG_WARNING:
    case CSF_LOG_INFO:
    case CSF_LOG_DEBUG:
    case CSF_LOG_VERBOSE:
      break;
  }

  return static_cast<CSFLogLevel>(priority);
}

void SDPLog(const SDPLogLevel priority, const char* sourceFile,
            const int sourceLine, const char* tag, const char* format, ...) {
  va_list ap;
  va_start(ap, format);
  CSFLogV(SDPToCSFLogLevel(priority), sourceFile, sourceLine, tag, format, ap);
  va_end(ap);
}

void SDPLogV(const SDPLogLevel priority, const char* sourceFile,
             const int sourceLine, const char* tag, const char* format,
             va_list args) {
  CSFLogV(SDPToCSFLogLevel(priority), sourceFile, sourceLine, tag, format,
          args);
}

int SDPLogTestLevel(const SDPLogLevel priority) {
  return CSFLogTestLevel(SDPToCSFLogLevel(priority));
}

Messung V0.5 in Prozent
C=92 H=91 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.