コード例 #1
0
        public static void Log(DebugMessageType messageType, string logger, RaiseDebugEventCallBack raiseEvent,
                               object message, bool showInDebugConsole = false)
        {
            if (logger == null && !showInDebugConsole)
            {
                return;
            }

            var messageTypeStr    = messageType.ToString();
            var messageDataString =
                JsonConvert.SerializeObject(message, new JsonSerializerSettings
            {
                PreserveReferencesHandling = PreserveReferencesHandling.Objects
            });

            Log(messageType, logger, messageDataString);

            if (showInDebugConsole)
            {
                raiseEvent(messageTypeStr, messageDataString);
            }
        }
コード例 #2
0
 internal static void ShowMessageInConsole(string message, DebugMessageType type = DebugMessageType.Info, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
 {
     Debug.Print("[" + DateTime.Now.ToString() + "] " + type.ToString() + sourceFilePath + "(" + sourceLineNumber.ToString() + "): " + memberName + "() :: " + message);
 }