コード例 #1
0
        public void Log(LoggedFeature loggedFeature, string format, params object[] tokens)
        {
            if (!LoggingConfig.ShouldLogFeature(loggedFeature))
            {
                return;
            }

            string formatedMessage = FormatFeatureString(loggedFeature.name, format);

            LogValue(formatedMessage, Debug.Log, tokens);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            LoggedFeature other = (LoggedFeature)obj;

            return(other.name.Equals(name));
        }
コード例 #3
0
        public static bool ShouldLogFeature(LoggedFeature feature)
        {
#if UNITY_EDITOR
            // By default, log everything but todos.
            if (!EditorPrefs.HasKey(kConfigPrefix + feature))
            {
                return(feature != LoggedFeature.TODO);
            }

            return(EditorPrefs.GetBool(kConfigPrefix + feature));
#else
            return(feature != LoggedFeature.TODO);
#endif
        }
コード例 #4
0
        public void LogError(LoggedFeature loggedFeature, string format, params object[] tokens)
        {
            string formatedMessage = FormatFeatureString(loggedFeature.name, format);

            LogValue(formatedMessage, Debug.LogError, tokens);
        }
コード例 #5
0
 private static void Register(LoggedFeature feature)
 {
     _features.Add(feature);
 }
コード例 #6
0
        public static void SetShouldLogFeature(LoggedFeature feature, bool shouldLog)
        {
#if UNITY_EDITOR
            EditorPrefs.SetBool(kConfigPrefix + feature, shouldLog);
#endif
        }