本文整理汇总了C#中LogData.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LogData.ToString方法的具体用法?C# LogData.ToString怎么用?C# LogData.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogData
的用法示例。
在下文中一共展示了LogData.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
/// <summary>
/// ログを追加します。
/// </summary>
/// <param name="priority">優先度。</param>
/// <param name="message">ログ内容。</param>
public static void Add( int priority, string message ) {
LogData data = new LogData( DateTime.Now, priority, message );
lock ( Logger.Instance ) {
Logger.Instance.log.Add( data );
}
if ( Configuration.Config.Log.LogLevel <= priority ) {
if ( Logger.Instance.toDebugConsole ) {
System.Diagnostics.Debug.WriteLine( data.ToString() );
}
try {
Logger.Instance.LogAdded( data );
} catch ( Exception ex ) {
System.Diagnostics.Debug.WriteLine( ex.Message );
}
}
}
示例2: output
private void output (string message, LogLevel level)
{
lock (_sync) {
if (_level > level)
return;
LogData data = null;
try {
data = new LogData (level, new StackFrame (2, true), message);
_output (data, _file);
}
catch (Exception ex) {
data = new LogData (LogLevel.Fatal, new StackFrame (0, true), ex.Message);
Console.WriteLine (data.ToString ());
}
}
}
示例3: OutputLog
void OutputLog(LogData data, string path)
{
lock (_sync) {
_log.AppendLine (" " + data.ToString ());
_updated = true;
}
}
示例4: defaultOutput
private static void defaultOutput (LogData data, string path)
{
var log = data.ToString ();
Console.WriteLine (log);
if (path != null && path.Length > 0)
writeToFile (log, path);
}
示例5: ExportLog
private void ExportLog (LogData log)
{
if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
{
//Instead of the Clipboard
string str = WWW.EscapeURL(_selectedLogData.ToString());
Application.OpenURL("mailto:?subject=&body=" + str);
}
else
{
TextEditor te = new TextEditor();
te.content = new GUIContent(log.ToString());
te.SelectAll();
te.Copy();
}
}