mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-19 04:52:51 +08:00
Summary: @public Context-aware logging functions are an internal Yoga feature that will be used for Yoga’s JNI code. It will be possible to specify a context when calculating layout, which will be passed on to baseline and measure functions. This will be a private feature. Reviewed By: SidharthGuglani Differential Revision: D14123482 fbshipit-source-id: 8ba3b6c493bf79fe09831f22d2b6da44f09e3d95
27 lines
645 B
C++
27 lines
645 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 "YGConfig.h"
|
|
|
|
YGConfig::YGConfig(YGLogger logger) {
|
|
logger_.noContext = logger;
|
|
loggerUsesContext_ = false;
|
|
}
|
|
|
|
void YGConfig::log(
|
|
YGConfig* config,
|
|
YGNode* node,
|
|
YGLogLevel logLevel,
|
|
void* logContext,
|
|
const char* format,
|
|
va_list args) {
|
|
if (loggerUsesContext_) {
|
|
logger_.withContext(config, node, logLevel, logContext, format, args);
|
|
} else {
|
|
logger_.noContext(config, node, logLevel, format, args);
|
|
}
|
|
}
|