tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DDLogMessage.h (1516B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef DDLogMessage_h_
      8 #define DDLogMessage_h_
      9 
     10 #include "DDLogCategory.h"
     11 #include "DDLogObject.h"
     12 #include "DDLogValue.h"
     13 #include "DDMessageIndex.h"
     14 #include "DDTimeStamp.h"
     15 #include "nsString.h"
     16 
     17 namespace mozilla {
     18 
     19 class DDLifetimes;
     20 
     21 // Structure containing all the information needed in each log message
     22 // (before and after processing).
     23 struct DDLogMessage {
     24  DDMessageIndex mIndex;
     25  DDTimeStamp mTimeStamp;
     26  DDLogObject mObject;
     27  DDLogCategory mCategory;
     28  const char* mLabel;
     29  DDLogValue mValue = DDLogValue{DDNoValue{}};
     30 
     31  // Print the message. Format:
     32  // "index | timestamp | object | category | label | value". E.g.:
     33  // "29 | 5.047547 | dom::HTMLMediaElement[134073800] | lnk | decoder |
     34  // MediaDecoder[136078200]"
     35  nsCString Print() const;
     36 
     37  // Print the message, using object information from aLifetimes. Format:
     38  // "index | timestamp | object | category | label | value". E.g.:
     39  // "29 | 5.047547 | dom::HTMLVideoElement[134073800]#1 (as
     40  // dom::HTMLMediaElement) | lnk | decoder | MediaSourceDecoder[136078200]#5
     41  // (as MediaDecoder)"
     42  nsCString Print(const DDLifetimes& aLifetimes) const;
     43 };
     44 
     45 }  // namespace mozilla
     46 
     47 #endif  // DDLogMessage_h_