1// Copyright 2017 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#pragma once
6
7#include <stdint.h>
8#include <stdio.h>
9
10#define LOG_ERROR    0x001
11#define LOG_INFO     0x002
12#define LOG_TRACE    0x004
13#define LOG_SPEW     0x008
14#define LOG_RPC_IN   0x010
15#define LOG_RPC_OUT  0x020
16#define LOG_RPC_RIO  0x040
17#define LOG_RPC_SDW  0x080
18#define LOG_DEVFS    0x100
19#define LOG_DEVLC    0x200
20#define LOG_ALL      0x177
21
22extern uint32_t log_flags;
23
24#define log(flag, fmt...) do { if (LOG_##flag & log_flags) printf(fmt); } while (0)
25