mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
307f54832d
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada
30 lines
586 B
C++
30 lines
586 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "ReactNativeLogger.h"
|
|
#include <glog/logging.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
namespace ReactNativeLogger {
|
|
|
|
void info(std::string const &text) {
|
|
LOG(INFO) << text;
|
|
}
|
|
|
|
void warning(std::string const &text) {
|
|
LOG(WARNING) << text;
|
|
}
|
|
|
|
void error(std::string const &text) {
|
|
LOG(ERROR) << text;
|
|
}
|
|
|
|
} // namespace ReactNativeLogger
|
|
} // namespace react
|
|
} // namespace facebook
|