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/. */
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
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
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
38 Maybe
<nsCString
> CallingScriptLocationString();
39 void LogCallingScriptLocation(void* instance
);
40 void LogCallingScriptLocation(void* instance
,
41 const Maybe
<nsCString
>& aLogLocation
);
42 extern LazyLogModule gHttpLog
;
44 } // namespace mozilla
48 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Error, args)
50 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Warning, args)
52 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Info, args)
54 MOZ_LOG(mozilla::net::gHttpLog, mozilla::LogLevel::Debug, 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()