blob: 779b551d621610fc546a286df5621d2a5638b3ad [file] [edit]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_FIRMWARE_PAVER_PAVE_LOGGING_H_
#define SRC_FIRMWARE_PAVER_PAVE_LOGGING_H_
#include <cstdio>
#define PAVER_PREFIX "paver:"
#define ERROR(fmt, ...) fprintf(stderr, PAVER_PREFIX "[%s] " fmt, __FUNCTION__, ##__VA_ARGS__);
#define LOG(fmt, ...) fprintf(stderr, PAVER_PREFIX "[%s] " fmt, __FUNCTION__, ##__VA_ARGS__);
namespace paver {
// Warn users about issues in a way that is intended to stand out from
// typical error logs. These errors typically require user intervention,
// or may result in data loss.
inline void Warn(const char* problem, const char* action) {
ERROR("-----------------------------------------------------\n");
ERROR("\n");
ERROR("%s:\n", problem);
ERROR("%s\n", action);
ERROR("\n");
ERROR("-----------------------------------------------------\n");
}
} // namespace paver
#endif // SRC_FIRMWARE_PAVER_PAVE_LOGGING_H_