リポジトリ
使用例
using UniLogEntriesInternal;
using UnityEditor;
using UnityEngine;
public class Example
{
[MenuItem( "Tools/Log" )]
private static void Log()
{
int count = 3;
for ( int i = 0; i < count; i++ )
{
Debug.Log( "ピカチュウ" );
Debug.Log( "ピカチュウ" );
Debug.Log( "ピカチュウ" );
Debug.LogWarning( "カイリュー" );
Debug.LogWarning( "カイリュー" );
Debug.LogError( "ヤドラン" );
}
}
[MenuItem( "LogEntriesInternal/" + nameof( RowGotDoubleClicked ) )]
private static void RowGotDoubleClicked()
{
LogEntries.RowGotDoubleClicked( 3 );
}
[MenuItem( "LogEntriesInternal/" + nameof( GetStatusText ) )]
private static void GetStatusText()
{
Debug.Log( LogEntries.GetStatusText() );
}
[MenuItem( "LogEntriesInternal/" + nameof( GetStatusMask ) )]
private static void GetStatusMask()
{
Debug.Log( LogEntries.GetStatusMask() );
}
[MenuItem( "LogEntriesInternal/" + nameof( SetConsoleFlag ) )]
private static void SetConsoleFlag()
{
LogEntries.SetConsoleFlag( ConsoleFlags.ClearOnPlay | ConsoleFlags.ClearOnBuild, false );
}
[MenuItem( "LogEntriesInternal/" + nameof( GetCount ) )]
private static void GetCount()
{
Debug.Log( LogEntries.GetCount() );
}
[MenuItem( "LogEntriesInternal/" + nameof( GetCountsByType ) )]
private static void GetCountsByType()
{
var errorCount = 0;
var warningCount = 0;
var logCount = 0;
LogEntries.GetCountsByType
(
errorCount: ref errorCount,
warningCount: ref warningCount,
logCount: ref logCount
);
Debug.Log( errorCount );
Debug.Log( warningCount );
Debug.Log( logCount );
}
[MenuItem( "LogEntriesInternal/" + nameof( GetEntryInternal ) )]
private static void GetEntryInternal()
{
LogEntries.StartGettingEntries();
Debug.Log( LogEntries.GetEntryInternal( 0, out var entry1 ) );
Debug.Log( entry1.message );
Debug.Log( entry1.file );
Debug.Log( entry1.line );
LogEntries.EndGettingEntries();
using ( new GettingEntriesScope() )
{
Debug.Log( LogEntries.GetEntryInternal( 0, out var entry2 ) );
Debug.Log( entry2.message );
Debug.Log( entry2.file );
Debug.Log( entry1.line );
}
}
[MenuItem( "LogEntriesInternal/" + nameof( GetEntryCount ) )]
private static void GetEntryCount()
{
Debug.Log( LogEntries.GetEntryCount( 8 ) );
}
[MenuItem( "LogEntriesInternal/" + nameof( Clear ) )]
private static void Clear()
{
LogEntries.Clear();
}
[MenuItem( "LogEntriesInternal/" + nameof( GetStatusViewErrorIndex ) )]
private static void GetStatusViewErrorIndex()
{
Debug.Log( LogEntries.GetStatusViewErrorIndex() );
}
[MenuItem( "LogEntriesInternal/" + nameof( ClickStatusBar ) )]
private static void ClickStatusBar()
{
LogEntries.ClickStatusBar( 0 );
}
}