void IPhotonPeerListener.DebugReturn(DebugLevel debugLevel, string debug) { if (log.IsDebugEnabled) { // we do not use debugLevel here - just log whatever debug we have log.DebugFormat(debug); } }
public void LogStringWithPrefix(string str, string prefix, DebugLevel debugLevel) { StreamWriter stream = StreamSelector (debugLevel); if (stream != null) { stream.WriteLine ("{0}{1}", prefix, str); stream.Flush (); } }
private static void Log(DebugLevel priority, string tag, string msg) { var logger = AxolotlLoggerProvider.GetProvider(); if (logger != null) { logger.Log(priority, tag, msg); } }
public void LogStringWithTimeStamp(string str, DebugLevel debugLevel) { StreamWriter stream = StreamSelector (debugLevel); if (stream != null) { stream.WriteLine ("{0} : [{1}] {2}", TimeStamp(), debugLevel.ToString(), str); stream.Flush (); } }
public static void ToFile(DebugLevel level, string message) { //Directory.CreateDirectory("Logs"); //StreamWriter file = new StreamWriter( // LOGFILE, // File.Exists(LOGFILE)); //file.WriteLine("[" + DateTime.Now.ToString() + "] " + // level.ToString() + ": " + message + "\n"); //file.Close(); }
/// <summary> /// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory" />. /// </summary> public Factory(FactoryType factoryType, DebugLevel debugLevel) : base(IntPtr.Zero) { FactoryOptions? options = null; if (debugLevel != DebugLevel.None) options = new FactoryOptions() { DebugLevel = debugLevel }; IntPtr temp; D2D1.CreateFactory(factoryType, Utilities.GetGuidFromType(GetType()), options, out temp); FromTemp(temp); }
private void Debug_DebugHandler(string arg1, DebugLevel arg2) { switch (arg2) { case DebugLevel.Info: UnityEngine.Debug.Log(arg1); break; case DebugLevel.Warning: UnityEngine.Debug.LogWarning(arg1); break; case DebugLevel.Error: UnityEngine.Debug.LogError(arg1); break; } }
private static void Debug_DebugHandler(string arg1, DebugLevel arg2) { var consoleForegroundColorCashe = Console.ForegroundColor; switch (arg2) { case DebugLevel.Info: Console.ForegroundColor = ConsoleColor.White; break; case DebugLevel.Warning: Console.ForegroundColor = ConsoleColor.Yellow; break; case DebugLevel.Error: Console.ForegroundColor = ConsoleColor.Red; break; } Console.WriteLine(arg1); Console.ForegroundColor = consoleForegroundColorCashe; }
public void DebugReturn(DebugLevel level, string message) { if (level == DebugLevel.ERROR) { Debug.LogError(message); } else if (level == DebugLevel.WARNING) { Debug.LogWarning(message); } else if (level == DebugLevel.INFO && PhotonNetwork.logLevel >= PhotonLogLevel.Informational) { Debug.Log(message); } else if (level == DebugLevel.ALL && PhotonNetwork.logLevel == PhotonLogLevel.Full) { Debug.Log(message); } }
//string Prefix = "" //public static void Debug(string content, DebugLevel level = DebugLevel.Info, // Output way = Output.Console, MenuItem DebugMenu = null) //{ // if (DebugMenu != null && !DebugMenu.GetValue<bool>()) return; // if (way == Output.Console) // { // ConsoleColor color = ConsoleColor.White; // if (level == DebugLevel.Info) // { // color = ConsoleColor.Green; // } // else if (level == DebugLevel.Warning) // { // color = ConsoleColor.Yellow; // } // else if (level == DebugLevel.Wrang) // { // color = ConsoleColor.Red; // } // Console.ForegroundColor = color; // Console.WriteLine(content); // Console.ForegroundColor = ConsoleColor.White; // } // else if(way == Output.ChatBox) // { // System.Drawing.Color color = System.Drawing.Color.White; // if (level == DebugLevel.Info) // { // color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF"); // } // else if (level == DebugLevel.Warning) // { // color = System.Drawing.Color.Orange; // } // else if (level == DebugLevel.Wrang) // { // color = System.Drawing.Color.Red; // } // Game.PrintChat(content.ToHtml(color, FontStlye.Cite)); // } //} public static void Debug(string content, DebugLevel level = DebugLevel.Info, Output way = Output.Console, bool enable = true) { if (!enable) return; if (way == Output.Console) { ConsoleColor color = ConsoleColor.White; if (level == DebugLevel.Info) { color = ConsoleColor.Green; } else if (level == DebugLevel.Warning) { color = ConsoleColor.Yellow; } else if (level == DebugLevel.Wrang) { color = ConsoleColor.Red; } Console.ForegroundColor = color; Console.WriteLine(content); Console.ForegroundColor = ConsoleColor.White; } else if (way == Output.ChatBox) { System.Drawing.Color color = System.Drawing.Color.White; if (level == DebugLevel.Info) { color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF"); } else if (level == DebugLevel.Warning) { color = System.Drawing.Color.Orange; } else if (level == DebugLevel.Wrang) { color = System.Drawing.Color.Red; } Game.PrintChat(content.ToHtml(color, FontStlye.Cite)); } }
public static void Write(string Prefix, string content, DebugLevel level = DebugLevel.Info, WriteWay way = WriteWay.Console, bool enable = true) { if (!enable) return; if (way == WriteWay.Console) { ConsoleColor color = ConsoleColor.White; if (level == DebugLevel.Info) { color = ConsoleColor.DarkGreen; } else if (level == DebugLevel.Warning) { color = ConsoleColor.Yellow; } else if (level == DebugLevel.Wrang) { color = ConsoleColor.Red; } Console.ForegroundColor = color; Console.WriteLine(!string.IsNullOrEmpty(Prefix) ? (Prefix + ":"+ content) : "" + content); Console.ForegroundColor = ConsoleColor.White; } else { System.Drawing.Color color = System.Drawing.Color.White; if (level == DebugLevel.Info) { color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF"); } else if (level == DebugLevel.Warning) { color = System.Drawing.Color.Orange; } else if (level == DebugLevel.Wrang) { color = System.Drawing.Color.Red; } content = (string.IsNullOrEmpty(Prefix) ? (Prefix + ":") : "") + content; Game.PrintChat(content.ToHtml(color, FontStlye.Cite)); } }
public static void Debug(string content, DebugLevel level = DebugLevel.Info, Output way = Output.Console) { if (way == Output.Console) { ConsoleColor color = ConsoleColor.White; if (level == DebugLevel.Info) { color = ConsoleColor.Green; } else if (level == DebugLevel.Warning) { color = ConsoleColor.Yellow; } else if (level == DebugLevel.Wrang) { color = ConsoleColor.Red; } Console.ForegroundColor = color; Console.WriteLine("AS锤石:" + content); Console.ForegroundColor = ConsoleColor.White; } else if(Thresh.Config.Item("调试").GetValue<bool>()) { System.Drawing.Color color = System.Drawing.Color.White; if (level == DebugLevel.Info) { color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF"); } else if (level == DebugLevel.Warning) { color = System.Drawing.Color.Orange; } else if (level == DebugLevel.Wrang) { color = System.Drawing.Color.Red; } } }
public string DialVoice(string number, bool showNumber, int gammuRcSection, DebugLevel debugLevel) { if (number == null) throw new ArgumentNullException("number"); try{ //_sm.DialVoice(number); var con = _sm.Contacts; } catch (GammuException ex) { throw new FaultException<GammuErrInfo> (new GammuErrInfo { ErrorCode = ex.ErrorCode, Message = ex.Text }); } return string.Format("Dial number {0}With result ", number) ; }
/// <summary> /// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory1" />. /// </summary> public Factory1(FactoryType factoryType, DebugLevel debugLevel) : base(factoryType, debugLevel) { }
public void DebugReturn(DebugLevel level, string message) { Console.WriteLine(string.Format("{0}: {1}", level, message)); }
public void DebugReturn(DebugLevel level, string message) { Debug.Log(message); }
/// <summary> /// The debug return. /// </summary> /// <param name = "debugLevel"> /// The debug Level. /// </param> /// <param name = "debug"> /// The debug message. /// </param> public void DebugReturn(DebugLevel debugLevel, string debug) { switch (debugLevel) { case DebugLevel.ALL: if (log.IsDebugEnabled) { log.Debug("DebugReturn: " + debug); } break; case DebugLevel.INFO: log.Info("DebugReturn(INFO): " + debug); break; case DebugLevel.WARNING: log.Warn("DebugReturn(WARN): " + debug); break; case DebugLevel.ERROR: log.Error("DebugReturn(ERROR): " + debug); break; } }
static GlobalDebug() { GlobalDebug.debugLevel = GlobalConfig.DebugLevel; }
public VoiceLogger(Object context, string tag, DebugLevel level = DebugLevel.ERROR) { this.context = context; this.Tag = tag; this.LogLevel = level; }
public void DebugReturn(DebugLevel level, string message) { // log message to console Debug.Log(message); }
public void DebugReturn(DebugLevel level, string message) { }
public static void AddDebugLevel(DebugLevel level) { AddDebugLevel((int)level); }
void IPhotonPeerListener.DebugReturn(DebugLevel level, string message) { this.listener.DebugReturn(level, message); }
public void DebugReturn(DebugLevel level, string message) { Debug.LogError(message); }
public override void OnInspectorGUI() { ServerSettings settings = (ServerSettings)target; Undo.RecordObject(settings, "Edit PhotonServerSettings"); settings.HostType = (ServerSettings.HostingOption)EditorGUILayout.EnumPopup("Hosting", settings.HostType); EditorGUI.indentLevel = 1; switch (settings.HostType) { case ServerSettings.HostingOption.BestRegion: case ServerSettings.HostingOption.PhotonCloud: // region selection if (settings.HostType == ServerSettings.HostingOption.PhotonCloud) { settings.PreferredRegion = (CloudRegionCode)EditorGUILayout.EnumPopup("Region", settings.PreferredRegion); } else { string _regionFeedback = "Prefs:" + ServerSettings.BestRegionCodeInPreferences.ToString(); // the NameServer does not have a region itself. it's global (although it has regional instances) if (PhotonNetwork.connected && PhotonNetwork.Server != ServerConnection.NameServer) { _regionFeedback = "Current:" + PhotonNetwork.CloudRegion + " " + _regionFeedback; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel(" "); Rect rect = GUILayoutUtility.GetRect(new GUIContent(_regionFeedback), "Label"); int indentLevel = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; EditorGUI.LabelField(rect, _regionFeedback); EditorGUI.indentLevel = indentLevel; rect.x += rect.width - 39; rect.width = 39; rect.height -= 2; if (GUI.Button(rect, "Reset", EditorStyles.miniButton)) { ServerSettings.ResetBestRegionCodeInPreferences(); } EditorGUILayout.EndHorizontal(); CloudRegionFlag valRegions = (CloudRegionFlag)EditorGUILayout.EnumMaskField("Enabled Regions", settings.EnabledRegions); if (valRegions != settings.EnabledRegions) { settings.EnabledRegions = valRegions; this.showMustHaveRegion = valRegions == 0; } if (this.showMustHaveRegion) { EditorGUILayout.HelpBox("You should enable at least two regions for 'Best Region' hosting.", MessageType.Warning); } } // appid string valAppId = EditorGUILayout.TextField("AppId", settings.AppID); if (valAppId != settings.AppID) { settings.AppID = valAppId.Trim(); } if (!ServerSettings.IsAppId(settings.AppID)) { EditorGUILayout.HelpBox("PUN needs an AppId (GUID).\nFind it online in the Dashboard.", MessageType.Warning); } // protocol ConnectionProtocol valProtocol = settings.Protocol; valProtocol = (ConnectionProtocol)EditorGUILayout.EnumPopup("Protocol", valProtocol); settings.Protocol = (ConnectionProtocol)valProtocol; #if UNITY_WEBGL EditorGUILayout.HelpBox("WebGL always use Secure WebSockets as protocol.\nThis setting gets ignored in current export.", MessageType.Warning); #endif break; case ServerSettings.HostingOption.SelfHosted: // address and port (depends on protocol below) bool hidePort = false; if (settings.Protocol == ConnectionProtocol.Udp && (settings.ServerPort == 4530 || settings.ServerPort == 0)) { settings.ServerPort = 5055; } else if (settings.Protocol == ConnectionProtocol.Tcp && (settings.ServerPort == 5055 || settings.ServerPort == 0)) { settings.ServerPort = 4530; } #if RHTTP if (settings.Protocol == ConnectionProtocol.RHttp) { settings.ServerPort = 0; hidePort = true; } #endif settings.ServerAddress = EditorGUILayout.TextField("Server Address", settings.ServerAddress); settings.ServerAddress = settings.ServerAddress.Trim(); if (!hidePort) { settings.ServerPort = EditorGUILayout.IntField("Server Port", settings.ServerPort); } // protocol valProtocol = settings.Protocol; valProtocol = (ConnectionProtocol)EditorGUILayout.EnumPopup("Protocol", valProtocol); settings.Protocol = (ConnectionProtocol)valProtocol; #if UNITY_WEBGL EditorGUILayout.HelpBox("WebGL always use Secure WebSockets as protocol.\nThis setting gets ignored in current export.", MessageType.Warning); #endif // appid settings.AppID = EditorGUILayout.TextField("AppId", settings.AppID); settings.AppID = settings.AppID.Trim(); break; case ServerSettings.HostingOption.OfflineMode: EditorGUI.indentLevel = 0; EditorGUILayout.HelpBox("In 'Offline Mode', the client does not communicate with a server.\nAll settings are hidden currently.", MessageType.Info); break; case ServerSettings.HostingOption.NotSet: EditorGUI.indentLevel = 0; EditorGUILayout.HelpBox("Hosting is 'Not Set'.\nConnectUsingSettings() will not be able to connect.\nSelect another option or run the PUN Wizard.", MessageType.Info); break; default: DrawDefaultInspector(); break; } if (PhotonEditor.CheckPunPlus()) { settings.Protocol = ConnectionProtocol.Udp; EditorGUILayout.HelpBox("You seem to use PUN+.\nPUN+ only supports reliable UDP so the protocol is locked.", MessageType.Info); } // CHAT SETTINGS if (PhotonEditorUtils.HasChat) { GUILayout.Space(5); EditorGUI.indentLevel = 0; EditorGUILayout.LabelField("Photon Chat Settings"); EditorGUI.indentLevel = 1; string valChatAppid = EditorGUILayout.TextField("Chat AppId", settings.ChatAppID); if (valChatAppid != settings.ChatAppID) { settings.ChatAppID = valChatAppid.Trim(); } if (!ServerSettings.IsAppId(settings.ChatAppID)) { EditorGUILayout.HelpBox("Photon Chat needs an AppId (GUID).\nFind it online in the Dashboard.", MessageType.Warning); } EditorGUI.indentLevel = 0; } // VOICE SETTINGS if (PhotonEditorUtils.HasVoice) { GUILayout.Space(5); EditorGUI.indentLevel = 0; EditorGUILayout.LabelField("Photon Voice Settings"); EditorGUI.indentLevel = 1; switch (settings.HostType) { case ServerSettings.HostingOption.BestRegion: case ServerSettings.HostingOption.PhotonCloud: // voice appid string valVoiceAppId = EditorGUILayout.TextField("Voice AppId", settings.VoiceAppID); if (valVoiceAppId != settings.VoiceAppID) { settings.VoiceAppID = valVoiceAppId.Trim(); } if (!ServerSettings.IsAppId(settings.VoiceAppID)) { EditorGUILayout.HelpBox("Photon Voice needs an AppId (GUID).\nFind it online in the Dashboard.", MessageType.Warning); } break; case ServerSettings.HostingOption.SelfHosted: if (settings.VoiceServerPort == 0) { settings.VoiceServerPort = 5055; } settings.VoiceServerPort = EditorGUILayout.IntField("Server Port UDP", settings.VoiceServerPort); break; case ServerSettings.HostingOption.OfflineMode: case ServerSettings.HostingOption.NotSet: break; } EditorGUI.indentLevel = 0; } // PUN Client Settings GUILayout.Space(5); EditorGUI.indentLevel = 0; EditorGUILayout.LabelField("Client Settings"); EditorGUI.indentLevel = 1; //EditorGUILayout.LabelField("game version"); settings.JoinLobby = EditorGUILayout.Toggle("Auto-Join Lobby", settings.JoinLobby); settings.EnableLobbyStatistics = EditorGUILayout.Toggle("Enable Lobby Stats", settings.EnableLobbyStatistics); // Pun Logging Level PhotonLogLevel _PunLogging = (PhotonLogLevel)EditorGUILayout.EnumPopup("Pun Logging", settings.PunLogging); if (EditorApplication.isPlaying && PhotonNetwork.logLevel != _PunLogging) { PhotonNetwork.logLevel = _PunLogging; } settings.PunLogging = _PunLogging; // Network Logging Level DebugLevel _DebugLevel = (DebugLevel)EditorGUILayout.EnumPopup("Network Logging", settings.NetworkLogging); if (EditorApplication.isPlaying && settings.NetworkLogging != _DebugLevel) { settings.NetworkLogging = _DebugLevel; } settings.NetworkLogging = _DebugLevel; //EditorGUILayout.LabelField("automaticallySyncScene"); //EditorGUILayout.LabelField("autoCleanUpPlayerObjects"); //EditorGUILayout.LabelField("lobby stats"); //EditorGUILayout.LabelField("sendrate / serialize rate"); //EditorGUILayout.LabelField("quick resends"); //EditorGUILayout.LabelField("max resends"); //EditorGUILayout.LabelField("enable crc checking"); // Application settings GUILayout.Space(5); EditorGUI.indentLevel = 0; EditorGUILayout.LabelField("Build Settings"); EditorGUI.indentLevel = 1; settings.RunInBackground = EditorGUILayout.Toggle("Run In Background", settings.RunInBackground); // RPC-shortcut list GUILayout.Space(5); EditorGUI.indentLevel = 0; SerializedObject sObj = new SerializedObject(target); SerializedProperty sRpcs = sObj.FindProperty("RpcList"); EditorGUILayout.PropertyField(sRpcs, true); sObj.ApplyModifiedProperties(); GUILayout.BeginHorizontal(); GUILayout.Space(20); if (GUILayout.Button("Refresh RPCs")) { PhotonEditor.UpdateRpcList(); Repaint(); } if (GUILayout.Button("Clear RPCs")) { PhotonEditor.ClearRpcList(); } if (GUILayout.Button("Log HashCode")) { Debug.Log("RPC-List HashCode: " + RpcListHashCode() + ". Make sure clients that send each other RPCs have the same RPC-List."); } GUILayout.Space(20); GUILayout.EndHorizontal(); //SerializedProperty sp = serializedObject.FindProperty("RpcList"); //EditorGUILayout.PropertyField(sp, true); if (GUI.changed) { EditorUtility.SetDirty(target); // even in Unity 5.3+ it's OK to SetDirty() for non-scene objects. } }
public static void DebugWrite <T>(DebugLevel _d, T msg) { DebugWrite(_d, msg.ToString()); }
public ConsoleMessage(string message, DebugLevel level) { Message = message; ConsoleMessageDebugLevel = level; }
public static DebugEchoPacket CreateDebugEchoPacket(string message, DebugLevel level) { return(new DebugEchoPacket(message, (byte)level, Color.White)); }
public static void RemoveDebugLevel(DebugLevel level) { RemoveDebugLevel((int)level); }
public VoiceLogger(string tag, DebugLevel level = DebugLevel.ERROR) { this.Tag = tag; this.LogLevel = level; }
void IChatClientListener.DebugReturn(DebugLevel level, string message) { }
public void DebugReturn(DebugLevel level, string message) { Console.WriteLine($"[{level.ToString()}] - {message}"); }
public override void DebugReturn(DebugLevel level, string message) { base.DebugReturn(level, message); Debug.Log(message); }
public override void DebugReturn(DebugLevel level, string message) { base.DebugReturn(level, message); logger.Append(String.Format("{0}", message)); logger.Flush(); }
public void DebugReturn(DebugLevel level, string message) { _controlledView.LogDebug(string.Format("{0} - {1}", level, message)); }
public void DebugReturn(DebugLevel level, string message) { // throw new NotImplementedException(); }
public static bool DebugLevelIsEnabled(DebugLevel level) { return(DebugLevelIsEnabled((int)level)); }
public ConfigSettings(DebugLevel debugLevel, string debugLogFile) { this.debugLevel = debugLevel; this.debugLogFile = debugLogFile; }
public static void LogErrorFormat(DebugLevel debugLevel, Object context, string format, params object[] args) { LogErrorFormat((int)debugLevel, context, format, args); }
public void DebugReturn(DebugLevel level, string message) { if (!this.logConnectErrors && message.Contains("Connect() failed:")) { return; } switch (level) { case DebugLevel.ERROR: log.Error(message); break; case DebugLevel.WARNING: log.Warn(message); break; case DebugLevel.INFO: log.Info(message); break; default: log.Debug(message); break; } }
public static void LogErrorFormat(DebugLevel debugLevel, string format, params object[] args) { LogErrorFormat((int)debugLevel, null, format, args); }
public static void Inform (DebugLevel level, String info) { if (level <= debug) { Console.Error.WriteLine (info); } }
/// <summary> /// This method is from the IPhotonPeerListener interface and called by the library with /// information during development. /// </summary> /// <remarks>Described in the client reference doc: Photon-DotNet-Client-Documentation_v6-1-0.pdf.</remarks> /// <param name="level"></param> /// <param name="message"></param> public void DebugReturn(DebugLevel level, string message) { this.DebugReturn(message); }
/// <summary> /// The debug return. /// </summary> /// <param name = "logLevel"> /// The log Level. /// </param> /// <param name = "message"> /// The message. /// </param> public void DebugReturn(DebugLevel logLevel, string message) { switch (logLevel) { case DebugLevel.ALL: { if (log.IsDebugEnabled) { log.Debug(message); } break; } case DebugLevel.INFO: { if (log.IsInfoEnabled) { log.Info(message); } break; } case DebugLevel.ERROR: { if (log.IsErrorEnabled) { log.Error(message); } break; } case DebugLevel.WARNING: { if (log.IsWarnEnabled) { log.Warn(message); } break; } } }
public static void WriteChatBox(string content, DebugLevel level = DebugLevel.Info, bool enable = true) { Write(null, content, level, WriteWay.ChatBox, enable); }
public void DebugReturn(DebugLevel level, string message) { this.externalListener.DebugReturn(level, message); }
public void DebugReturn(DebugLevel level, string message) { //Debug.LogError("DebugReturn " + message); }
public static void Write(string content, DebugLevel level = DebugLevel.Info, WriteWay way = WriteWay.Console, bool enable = true) { Write(null, content, level, way, enable); }
public void DebugReturn(DebugLevel level, string message) { Console.WriteLine(message); }
public static void WriteConsole(string Prefix, string content, DebugLevel level = DebugLevel.Info, bool enable = true) { Write(Prefix, content,level,WriteWay.Console,enable); }
/// <summary> /// Set the level (if any) of debug logging. /// </summary> /// <remarks>Log messages will be passed to the callback registered in InitParams.LogOutput.</remarks> /// <param name="aLevel">Bit(s) specifying which debug levels to enable</param> public static void SetDebugLevel(DebugLevel aLevel) { OhNetDebugSetLevel((uint)aLevel); }
public void EnqueueDebugReturn(DebugLevel debugLevel, string message) { this.peerBase.EnqueueDebugReturn(debugLevel, message); }