Bug 1814798 - pt 2. Add a PHCManager component to control PHC r=glandium,emilio
[gecko.git] / netwerk / protocol / http / HttpLog.h
blob58de97590bef7a77a6e776cdc6884216cf201edd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=4 sw=2 sts=2 et cin: */
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/. */
7 #ifndef HttpLog_h__
8 #define HttpLog_h__
10 /*******************************************************************************
11 * This file should ONLY be #included by source (.cpp) files in the /http
12 * directory, not headers (.h). If you need to use LOG() in a .h file, call
13 * PR_LOG directly.
15 * This file should also be the first #include in your file.
17 * Yes, this is kludgy.
18 *******************************************************************************/
20 #include "mozilla/net/NeckoChild.h"
22 // Get rid of Chromium's LOG definition
23 #undef LOG
26 // Log module for HTTP Protocol logging...
28 // To enable logging (see prlog.h for full details):
30 // set MOZ_LOG=nsHttp:5
31 // set MOZ_LOG_FILE=http.log
33 // This enables LogLevel::Debug level information and places all output in
34 // the file http.log.
36 namespace mozilla {
37 namespace net {
38 Maybe<nsCString> CallingScriptLocationString();
39 void LogCallingScriptLocation(void* instance);
40 void LogCallingScriptLocation(void* instance,
41 const Maybe<nsCString>& aLogLocation);
42 extern LazyLogModule gHttpLog;
43 } // namespace net
44 } // namespace mozilla
46 // http logging
47 #define LOG1(args) \
48 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Error, args)
49 #define LOG2(args) \
50 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Warning, args)
51 #define LOG3(args) \
52 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Info, args)
53 #define LOG4(args) \
54 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Debug, args)
55 #define LOG5(args) \
56 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Verbose, args)
57 #define LOG(args) LOG4(args)
58 #define LOGTIME(start, args) \
59 MOZ_LOG_TIME(mozilla::net::gHttpLog, mozilla::LogLevel::Debug, &(start), args)
61 #define LOG1_ENABLED() \
62 MOZ_LOG_TEST(mozilla::net::gHttpLog, mozilla::LogLevel::Error)
63 #define LOG2_ENABLED() \
64 MOZ_LOG_TEST(mozilla::net::gHttpLog, mozilla::LogLevel::Warning)
65 #define LOG3_ENABLED() \
66 MOZ_LOG_TEST(mozilla::net::gHttpLog, mozilla::LogLevel::Info)
67 #define LOG4_ENABLED() \
68 MOZ_LOG_TEST(mozilla::net::gHttpLog, mozilla::LogLevel::Debug)
69 #define LOG5_ENABLED() \
70 MOZ_LOG_TEST(mozilla::net::gHttpLog, mozilla::LogLevel::Verbose)
71 #define LOG_ENABLED() LOG4_ENABLED()
73 #endif // HttpLog_h__