2013-11-05 06:16:25 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
2014-02-10 12:50:16 -08:00
|
|
|
#ifndef mozilla_Debug_h
|
|
|
|
#define mozilla_Debug_h
|
|
|
|
|
|
|
|
#include "nsString.h"
|
|
|
|
#include <stdio.h>
|
2013-11-05 06:16:25 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2014-02-10 12:50:16 -08:00
|
|
|
typedef uint32_t LogOptions;
|
2013-11-05 06:16:25 -08:00
|
|
|
|
2014-02-10 12:50:16 -08:00
|
|
|
// Print a message to the specified stream.
|
|
|
|
const LogOptions kPrintToStream = 1 << 0;
|
|
|
|
|
|
|
|
// Print a message to a debugger if the debugger is attached.
|
|
|
|
// At the moment, only meaningful on Windows.
|
|
|
|
const LogOptions kPrintToDebugger = 1 << 1;
|
|
|
|
|
|
|
|
// Print an info-level message to the log.
|
|
|
|
// At the moment, only meaningful on Andriod.
|
|
|
|
const LogOptions kPrintInfoLog = 1 << 2;
|
2013-11-05 06:16:25 -08:00
|
|
|
|
2014-02-10 12:50:16 -08:00
|
|
|
// Print an error-level message to the log.
|
|
|
|
// At the moment, only meaningful on Andriod.
|
|
|
|
const LogOptions kPrintErrorLog = 1 << 3;
|
|
|
|
|
|
|
|
// Print a new line after the message.
|
|
|
|
const LogOptions kPrintNewLine = 1 << 4;
|
|
|
|
|
|
|
|
// Print aStr to a debugger if the debugger is attached.
|
|
|
|
void PrintToDebugger(const nsAString& aStr, FILE* aStream,
|
|
|
|
LogOptions aOptions = kPrintToStream
|
|
|
|
| kPrintToDebugger
|
|
|
|
| kPrintInfoLog);
|
2013-11-05 06:16:25 -08:00
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-02-10 12:50:16 -08:00
|
|
|
#endif // mozilla_Debug_h
|