Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ReactCommon/react/renderer/components/view/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall

LOCAL_STATIC_LIBRARIES :=

LOCAL_SHARED_LIBRARIES := libyoga glog libfolly_json libglog_init libreact_render_core libreact_render_debug libreact_render_graphics libreact_debug
LOCAL_SHARED_LIBRARIES := libyoga glog libfolly_json libglog_init libreact_render_core libreact_render_debug libreact_render_graphics libreact_debug libreact_utils

include $(BUILD_SHARED_LIBRARY)

Expand All @@ -31,5 +31,6 @@ $(call import-module,fbgloginit)
$(call import-module,react/renderer/core)
$(call import-module,react/renderer/debug)
$(call import-module,react/renderer/graphics)
$(call import-module,react/utils)
$(call import-module,yogajni)
$(call import-module,react/debug)
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <react/renderer/core/LayoutContext.h>
#include <react/renderer/debug/DebugStringConvertibleItem.h>
#include <react/renderer/debug/SystraceSection.h>
#include <react/utils/ReactNativeLogger.h>
#include <yoga/Yoga.h>
#include <algorithm>
#include <limits>
Expand Down Expand Up @@ -226,7 +227,8 @@ void YogaLayoutableShadowNode::appendChild(

ensureConsistency();
} else {
LOG(ERROR) << "Text strings must be rendered within a <Text> component.";
ReactNativeLogger::error(
"Text strings must be rendered within a <Text> component.");
}
}

Expand Down
4 changes: 3 additions & 1 deletion ReactCommon/react/utils/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ LOCAL_CFLAGS := \
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall

LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := libreact_debug libreact_render_mapbuffer
LOCAL_SHARED_LIBRARIES := libreact_debug libreact_render_mapbuffer libglog libglog_init

include $(BUILD_SHARED_LIBRARY)

$(call import-module,react/debug)
$(call import-module,fbgloginit)
$(call import-module,glog)
$(call import-module,react/renderer/mapbuffer)
1 change: 1 addition & 0 deletions ReactCommon/react/utils/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ rn_xplat_cxx_library(
tests = [],
visibility = ["PUBLIC"],
deps = [
"//third-party/glog:glog",
"//xplat/folly:container_evicting_cache_map",
"//xplat/folly:headers_only",
"//xplat/folly:memory",
Expand Down
29 changes: 29 additions & 0 deletions ReactCommon/react/utils/ReactNativeLogger.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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
23 changes: 23 additions & 0 deletions ReactCommon/react/utils/ReactNativeLogger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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.
*/

#pragma once

#include <memory>
#include <string>

namespace facebook {
namespace react {
namespace ReactNativeLogger {

void info(std::string const &text);
void warning(std::string const &text);
void error(std::string const &text);

} // namespace ReactNativeLogger
} // namespace react
} // namespace facebook