示例#1
0
        public static void LoggerInternal(YogaLogLevel level, string message)
        {
            if (Logger != null)
            {
                Logger(level, message);
            }

            if (level == YogaLogLevel.Error)
            {
                throw new InvalidOperationException(message);
            }
        }
示例#2
0
        private static void LoggerInternal(
            IntPtr unmanagedConfigPtr,
            IntPtr unmanagedNodePtr,
            YogaLogLevel level,
            string message)
        {
            var config = YGConfigHandle.GetManaged(unmanagedConfigPtr);

            if (config == null || config._logger == null)
            {
                // Default logger
                System.Diagnostics.Debug.WriteLine(message);
            }
            else
            {
                var node = YGNodeHandle.GetManaged(unmanagedNodePtr);
                config._logger(config, node, level, message);
            }

            if (level == YogaLogLevel.Error || level == YogaLogLevel.Fatal)
            {
                throw new InvalidOperationException(message);
            }
        }