|
Packit Service |
9def5d |
// This file is automatically generated from src/glog/vlog_is_on.h.in
|
|
Packit Service |
9def5d |
// using src/windows/preprocess.sh.
|
|
Packit Service |
9def5d |
// DO NOT EDIT!
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Copyright (c) 1999, 2007, Google Inc.
|
|
Packit Service |
9def5d |
// All rights reserved.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// Redistribution and use in source and binary forms, with or without
|
|
Packit Service |
9def5d |
// modification, are permitted provided that the following conditions are
|
|
Packit Service |
9def5d |
// met:
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// * Redistributions of source code must retain the above copyright
|
|
Packit Service |
9def5d |
// notice, this list of conditions and the following disclaimer.
|
|
Packit Service |
9def5d |
// * Redistributions in binary form must reproduce the above
|
|
Packit Service |
9def5d |
// copyright notice, this list of conditions and the following disclaimer
|
|
Packit Service |
9def5d |
// in the documentation and/or other materials provided with the
|
|
Packit Service |
9def5d |
// distribution.
|
|
Packit Service |
9def5d |
// * Neither the name of Google Inc. nor the names of its
|
|
Packit Service |
9def5d |
// contributors may be used to endorse or promote products derived from
|
|
Packit Service |
9def5d |
// this software without specific prior written permission.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit Service |
9def5d |
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit Service |
9def5d |
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
Packit Service |
9def5d |
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
Packit Service |
9def5d |
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
Packit Service |
9def5d |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
Packit Service |
9def5d |
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
Packit Service |
9def5d |
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
Packit Service |
9def5d |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
Packit Service |
9def5d |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit Service |
9def5d |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// Author: Ray Sidney and many others
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// Defines the VLOG_IS_ON macro that controls the variable-verbosity
|
|
Packit Service |
9def5d |
// conditional logging.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// It's used by VLOG and VLOG_IF in logging.h
|
|
Packit Service |
9def5d |
// and by RAW_VLOG in raw_logging.h to trigger the logging.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// It can also be used directly e.g. like this:
|
|
Packit Service |
9def5d |
// if (VLOG_IS_ON(2)) {
|
|
Packit Service |
9def5d |
// // do some logging preparation and logging
|
|
Packit Service |
9def5d |
// // that can't be accomplished e.g. via just VLOG(2) << ...;
|
|
Packit Service |
9def5d |
// }
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// The truth value that VLOG_IS_ON(level) returns is determined by
|
|
Packit Service |
9def5d |
// the three verbosity level flags:
|
|
Packit Service |
9def5d |
// --v=<n> Gives the default maximal active V-logging level;
|
|
Packit Service |
9def5d |
// 0 is the default.
|
|
Packit Service |
9def5d |
// Normally positive values are used for V-logging levels.
|
|
Packit Service |
9def5d |
// --vmodule=<str> Gives the per-module maximal V-logging levels to override
|
|
Packit Service |
9def5d |
// the value given by --v.
|
|
Packit Service |
9def5d |
// E.g. "my_module=2,foo*=3" would change the logging level
|
|
Packit Service |
9def5d |
// for all code in source files "my_module.*" and "foo*.*"
|
|
Packit Service |
9def5d |
// ("-inl" suffixes are also disregarded for this matching).
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// SetVLOGLevel helper function is provided to do limited dynamic control over
|
|
Packit Service |
9def5d |
// V-logging by overriding the per-module settings given via --vmodule flag.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// CAVEAT: --vmodule functionality is not available in non gcc compilers.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
#ifndef BASE_VLOG_IS_ON_H_
|
|
Packit Service |
9def5d |
#define BASE_VLOG_IS_ON_H_
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
#include "glog/log_severity.h"
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Annoying stuff for windows -- makes sure clients can import these functions
|
|
Packit Service |
9def5d |
#ifndef GOOGLE_GLOG_DLL_DECL
|
|
Packit Service |
9def5d |
# if defined(_WIN32) && !defined(__CYGWIN__)
|
|
Packit Service |
9def5d |
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
|
|
Packit Service |
9def5d |
# else
|
|
Packit Service |
9def5d |
# define GOOGLE_GLOG_DLL_DECL
|
|
Packit Service |
9def5d |
# endif
|
|
Packit Service |
9def5d |
#endif
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
#if defined(__GNUC__)
|
|
Packit Service |
9def5d |
// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
|
|
Packit Service |
9def5d |
// (Normally) the first time every VLOG_IS_ON(n) site is hit,
|
|
Packit Service |
9def5d |
// we determine what variable will dynamically control logging at this site:
|
|
Packit Service |
9def5d |
// it's either FLAGS_v or an appropriate internal variable
|
|
Packit Service |
9def5d |
// matching the current source file that represents results of
|
|
Packit Service |
9def5d |
// parsing of --vmodule flag and/or SetVLOGLevel calls.
|
|
Packit Service |
9def5d |
#define VLOG_IS_ON(verboselevel) \
|
|
Packit Service |
9def5d |
__extension__ \
|
|
Packit Service |
9def5d |
({ static google::int32* vlocal__ = &google::kLogSiteUninitialized; \
|
|
Packit Service |
9def5d |
google::int32 verbose_level__ = (verboselevel); \
|
|
Packit Service |
9def5d |
(*vlocal__ >= verbose_level__) && \
|
|
Packit Service |
9def5d |
((vlocal__ != &google::kLogSiteUninitialized) || \
|
|
Packit Service |
9def5d |
(google::InitVLOG3__(&vlocal__, &FLAGS_v, \
|
|
Packit Service |
9def5d |
__FILE__, verbose_level__))); })
|
|
Packit Service |
9def5d |
#else
|
|
Packit Service |
9def5d |
// GNU extensions not available, so we do not support --vmodule.
|
|
Packit Service |
9def5d |
// Dynamic value of FLAGS_v always controls the logging level.
|
|
Packit Service |
9def5d |
#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
|
|
Packit Service |
9def5d |
#endif
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Set VLOG(_IS_ON) level for module_pattern to log_level.
|
|
Packit Service |
9def5d |
// This lets us dynamically control what is normally set by the --vmodule flag.
|
|
Packit Service |
9def5d |
// Returns the level that previously applied to module_pattern.
|
|
Packit Service |
9def5d |
// NOTE: To change the log level for VLOG(_IS_ON) sites
|
|
Packit Service |
9def5d |
// that have already executed after/during InitGoogleLogging,
|
|
Packit Service |
9def5d |
// one needs to supply the exact --vmodule pattern that applied to them.
|
|
Packit Service |
9def5d |
// (If no --vmodule pattern applied to them
|
|
Packit Service |
9def5d |
// the value of FLAGS_v will continue to control them.)
|
|
Packit Service |
9def5d |
extern GOOGLE_GLOG_DLL_DECL int SetVLOGLevel(const char* module_pattern,
|
|
Packit Service |
9def5d |
int log_level);
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Various declarations needed for VLOG_IS_ON above: =========================
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Special value used to indicate that a VLOG_IS_ON site has not been
|
|
Packit Service |
9def5d |
// initialized. We make this a large value, so the common-case check
|
|
Packit Service |
9def5d |
// of "*vlocal__ >= verbose_level__" in VLOG_IS_ON definition
|
|
Packit Service |
9def5d |
// passes in such cases and InitVLOG3__ is then triggered.
|
|
Packit Service |
9def5d |
extern google::int32 kLogSiteUninitialized;
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Helper routine which determines the logging info for a particalur VLOG site.
|
|
Packit Service |
9def5d |
// site_flag is the address of the site-local pointer to the controlling
|
|
Packit Service |
9def5d |
// verbosity level
|
|
Packit Service |
9def5d |
// site_default is the default to use for *site_flag
|
|
Packit Service |
9def5d |
// fname is the current source file name
|
|
Packit Service |
9def5d |
// verbose_level is the argument to VLOG_IS_ON
|
|
Packit Service |
9def5d |
// We will return the return value for VLOG_IS_ON
|
|
Packit Service |
9def5d |
// and if possible set *site_flag appropriately.
|
|
Packit Service |
9def5d |
extern GOOGLE_GLOG_DLL_DECL bool InitVLOG3__(
|
|
Packit Service |
9def5d |
google::int32** site_flag,
|
|
Packit Service |
9def5d |
google::int32* site_default,
|
|
Packit Service |
9def5d |
const char* fname,
|
|
Packit Service |
9def5d |
google::int32 verbose_level);
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
#endif // BASE_VLOG_IS_ON_H_
|