using System;
using System.Collections.Generic;
using UnityEngine;

namespace Jovian.Logger {
    public class LoggerSettings : ScriptableObject {
        public bool enableGlobalLogging = true;
        public Filters[] globalFilters = Array.Empty<Filters>();
        public LoggerColors loggerColors = new();

#if UNITY_EDITOR
        public List<Filters> LocalFilters { get; set; } = new();
#endif
        public void ResetColorsToDefault() {
            loggerColors = new LoggerColors();
        }
    }

    [Serializable]
    public class LoggerColors {
        public Color infoColor = Color.white;
        public Color warningColor = Color.yellow;
        public Color errorColor = Color.red;
        public Color assertColor = new(1f, 0.3f, 0.2f);
        public Color exceptionColor = new(1f, 0.0f, 0.7f);
        public Color spamColor = Color.grey;
    }

    [Serializable]
    public class Filters {
        public LogCategory logCategory = (LogCategory)~0;
        public JovianLogType jovianLogType = JovianLogType.Spam;
        public List<string> callerNames = new();
        public CallerListingType callerListingType = CallerListingType.Blacklist_Caller;
    }
}
