1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 
6 /*
7  * Common code for the unified fuzzing interface
8  */
9 
10 #include <stdlib.h>
11 #include "FuzzingInterface.h"
12 
13 namespace mozilla {
14 
15 #ifdef JS_STANDALONE
16 static bool fuzzing_verbose = !!getenv("MOZ_FUZZ_LOG");
fuzzing_log(const char * aFmt,...)17 void fuzzing_log(const char* aFmt, ...) {
18   if (fuzzing_verbose) {
19     va_list ap;
20     va_start(ap, aFmt);
21     vfprintf(stderr, aFmt, ap);
22     va_end(ap);
23   }
24 }
25 #else
26 LazyLogModule gFuzzingLog("nsFuzzing");
27 #endif
28 
29 }  // namespace mozilla
30