1894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe// Use of this source code is governed by a BSD-style license that can be
3894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe// found in the LICENSE file.
4894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
5894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#ifndef CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_LOGGING_H_
6894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#define CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_LOGGING_H_
7894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
8894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#include <errno.h>   // for errno
9894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#include <string.h>  // for strerror
10894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
11894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#include <iostream>
12894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#include <sstream>
13894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#include <string>
14894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
15894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#include "android-base/logging.h"
16894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
17894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe// Emulate Chrome-like logging.
18894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
19894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampenamespace logging {
20894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
21894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampeextern bool gVlogEnabled;
22894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
23894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe}  // namespace logging
24894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
25894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#define VLOG(level) ::logging::gVlogEnabled && LOG(INFO)
26894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
2777162c97e59b1e6b3895a97b3b9dfbe45422ad3fAndreas Gampe#define DLOG(x) android::base::kEnableDChecks && LOG(x)
2877162c97e59b1e6b3895a97b3b9dfbe45422ad3fAndreas Gampe#define DVLOG(x) android::base::kEnableDChecks && VLOG(x)
29894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe
30894ed1953498b645d1c1ead3311c47115ce4a5ffAndreas Gampe#endif  // CHROMIUMOS_WIDE_PROFILING_MYBASE_BASE_LOGGING_H_
31