mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 12:44:19 +01:00
Anonymized collection names for log
This commit is contained in:
parent
b5698acebf
commit
1c60a61f79
5 changed files with 21 additions and 22 deletions
|
|
@ -108,12 +108,12 @@ public partial class ModCollection
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginLog.Debug( "[{Thread}] Recalculating effective file list for {CollectionName:l}",
|
PluginLog.Debug( "[{Thread}] Recalculating effective file list for {CollectionName:l}",
|
||||||
Thread.CurrentThread.ManagedThreadId, Name );
|
Thread.CurrentThread.ManagedThreadId, AnonymizedName );
|
||||||
_cache ??= new Cache( this );
|
_cache ??= new Cache( this );
|
||||||
_cache.FullRecalculation();
|
_cache.FullRecalculation();
|
||||||
|
|
||||||
PluginLog.Debug( "[{Thread}] Recalculation of effective file list for {CollectionName:l} finished.",
|
PluginLog.Debug( "[{Thread}] Recalculation of effective file list for {CollectionName:l} finished.",
|
||||||
Thread.CurrentThread.ManagedThreadId, Name );
|
Thread.CurrentThread.ManagedThreadId, AnonymizedName );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Metadata files.
|
// Set Metadata files.
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public partial class ModCollection
|
||||||
collection.ModSettingChanged += OnInheritedModSettingChange;
|
collection.ModSettingChanged += OnInheritedModSettingChange;
|
||||||
collection.InheritanceChanged += OnInheritedInheritanceChange;
|
collection.InheritanceChanged += OnInheritedInheritanceChange;
|
||||||
InheritanceChanged.Invoke( false );
|
InheritanceChanged.Invoke( false );
|
||||||
PluginLog.Debug( "Added {InheritedName:l} to {Name:l} inheritances.", collection.Name, Name );
|
PluginLog.Debug( "Added {InheritedName:l} to {Name:l} inheritances.", collection.AnonymizedName, AnonymizedName );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@ public partial class ModCollection
|
||||||
inheritance.InheritanceChanged -= OnInheritedInheritanceChange;
|
inheritance.InheritanceChanged -= OnInheritedInheritanceChange;
|
||||||
_inheritance.RemoveAt( idx );
|
_inheritance.RemoveAt( idx );
|
||||||
InheritanceChanged.Invoke( false );
|
InheritanceChanged.Invoke( false );
|
||||||
PluginLog.Debug( "Removed {InheritedName:l} from {Name:l} inheritances.", inheritance.Name, Name );
|
PluginLog.Debug( "Removed {InheritedName:l} from {Name:l} inheritances.", inheritance.AnonymizedName, AnonymizedName );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order in the inheritance list is relevant.
|
// Order in the inheritance list is relevant.
|
||||||
|
|
@ -101,7 +101,7 @@ public partial class ModCollection
|
||||||
if( _inheritance.Move( from, to ) )
|
if( _inheritance.Move( from, to ) )
|
||||||
{
|
{
|
||||||
InheritanceChanged.Invoke( false );
|
InheritanceChanged.Invoke( false );
|
||||||
PluginLog.Debug( "Moved {Name:l}s inheritance {From} to {To}.", Name, from, to );
|
PluginLog.Debug( "Moved {Name:l}s inheritance {From} to {To}.", AnonymizedName, from, to );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,11 @@ public partial class ModCollection
|
||||||
// The collection name can contain invalid path characters,
|
// The collection name can contain invalid path characters,
|
||||||
// but after removing those and going to lower case it has to be unique.
|
// but after removing those and going to lower case it has to be unique.
|
||||||
public string Name { get; private init; }
|
public string Name { get; private init; }
|
||||||
|
|
||||||
|
// Get the first two letters of a collection name and its Index (or None if it is the empty collection).
|
||||||
|
public string AnonymizedName
|
||||||
|
=> this == Empty ? Empty.Name : Name.Length > 2 ? $"{Name[..2]}... ({Index})" : $"{Name} ({Index})";
|
||||||
|
|
||||||
public int Version { get; private set; }
|
public int Version { get; private set; }
|
||||||
public int Index { get; private set; } = -1;
|
public int Index { get; private set; } = -1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public unsafe partial class ResourceLoader
|
||||||
{
|
{
|
||||||
if( handle != null )
|
if( handle != null )
|
||||||
{
|
{
|
||||||
PluginLog.Information( "[ResourceLoader] Destructing Resource Handle {Path:l} at 0x{Address:X} (Refcount {Refcount}) .",
|
PluginLog.Information( "[ResourceLoader] Destructing Resource Handle {Path:l} at 0x{Address:X} (Refcount {Refcount}).",
|
||||||
handle->FileName, ( ulong )handle, handle->RefCount );
|
handle->FileName, ( ulong )handle, handle->RefCount );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -436,42 +436,36 @@ public class Penumbra : IDalamudPlugin
|
||||||
ModManager.Sum( m => m.TotalManipulations ) );
|
ModManager.Sum( m => m.TotalManipulations ) );
|
||||||
sb.AppendFormat( "> **`IMC Exceptions Thrown: `** {0}\n", ImcExceptions );
|
sb.AppendFormat( "> **`IMC Exceptions Thrown: `** {0}\n", ImcExceptions );
|
||||||
|
|
||||||
string CollectionName( ModCollection c )
|
|
||||||
=> c == ModCollection.Empty ? ModCollection.Empty.Name : c.Name.Length >= 2 ? c.Name[ ..2 ] : c.Name;
|
|
||||||
|
|
||||||
string CharacterName( string name )
|
string CharacterName( string name )
|
||||||
=> string.Join( " ", name.Split().Select( n => $"{n[ 0 ]}." ) ) + ':';
|
=> string.Join( " ", name.Split().Select( n => $"{n[ 0 ]}." ) ) + ':';
|
||||||
|
|
||||||
void PrintCollection( ModCollection c )
|
void PrintCollection( ModCollection c )
|
||||||
=> sb.AppendFormat( "**Collection {0}... ({1})**\n"
|
=> sb.AppendFormat( "**Collection {0}**\n"
|
||||||
+ "> **`Inheritances: `** {2}\n"
|
+ "> **`Inheritances: `** {1}\n"
|
||||||
+ "> **`Enabled Mods: `** {3}\n"
|
+ "> **`Enabled Mods: `** {2}\n"
|
||||||
+ "> **`Total Conflicts: `** {4}\n"
|
+ "> **`Total Conflicts: `** {3}\n"
|
||||||
+ "> **`Solved Conflicts: `** {5}\n",
|
+ "> **`Solved Conflicts: `** {4}\n",
|
||||||
CollectionName( c ), c.Index, c.Inheritance.Count, c.ActualSettings.Count( s => s is { Enabled: true } ),
|
c.AnonymizedName, c.Inheritance.Count, c.ActualSettings.Count( s => s is { Enabled: true } ),
|
||||||
c.AllConflicts.SelectMany( x => x ).Sum( x => x.HasPriority ? 0 : x.Conflicts.Count ),
|
c.AllConflicts.SelectMany( x => x ).Sum( x => x.HasPriority ? 0 : x.Conflicts.Count ),
|
||||||
c.AllConflicts.SelectMany( x => x ).Sum( x => x.HasPriority || !x.Solved ? 0 : x.Conflicts.Count ) );
|
c.AllConflicts.SelectMany( x => x ).Sum( x => x.HasPriority || !x.Solved ? 0 : x.Conflicts.Count ) );
|
||||||
|
|
||||||
sb.AppendLine( "**Collections**" );
|
sb.AppendLine( "**Collections**" );
|
||||||
sb.AppendFormat( "> **`#Collections: `** {0}\n", CollectionManager.Count - 1 );
|
sb.AppendFormat( "> **`#Collections: `** {0}\n", CollectionManager.Count - 1 );
|
||||||
sb.AppendFormat( "> **`Active Collections: `** {0}\n", CollectionManager.Count( c => c.HasCache ) );
|
sb.AppendFormat( "> **`Active Collections: `** {0}\n", CollectionManager.Count( c => c.HasCache ) );
|
||||||
sb.AppendFormat( "> **`Default Collection: `** {0}... ({1})\n", CollectionName( CollectionManager.Default ),
|
sb.AppendFormat( "> **`Default Collection: `** {0}\n", CollectionManager.Default.AnonymizedName);
|
||||||
CollectionManager.Default.Index );
|
sb.AppendFormat( "> **`Current Collection: `** {0}\n", CollectionManager.Current.AnonymizedName);
|
||||||
sb.AppendFormat( "> **`Current Collection: `** {0}... ({1})\n", CollectionName( CollectionManager.Current ),
|
|
||||||
CollectionManager.Current.Index );
|
|
||||||
foreach( var type in CollectionTypeExtensions.Special )
|
foreach( var type in CollectionTypeExtensions.Special )
|
||||||
{
|
{
|
||||||
var collection = CollectionManager.ByType( type );
|
var collection = CollectionManager.ByType( type );
|
||||||
if( collection != null )
|
if( collection != null )
|
||||||
{
|
{
|
||||||
sb.AppendFormat( "> **`{0,-29}`** {1}... ({2})\n", type.ToName(), CollectionName( collection ), collection.Index );
|
sb.AppendFormat( "> **`{0,-29}`** {1}\n", type.ToName(), collection.AnonymizedName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach( var (name, collection) in CollectionManager.Characters )
|
foreach( var (name, collection) in CollectionManager.Characters )
|
||||||
{
|
{
|
||||||
sb.AppendFormat( "> **`{2,-29}`** {0}... ({1})\n", CollectionName( collection ),
|
sb.AppendFormat( "> **`{2,-29}`** {0}\n", collection.AnonymizedName, CharacterName( name ) );
|
||||||
collection.Index, CharacterName( name ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach( var collection in CollectionManager.Where( c => c.HasCache ) )
|
foreach( var collection in CollectionManager.Where( c => c.HasCache ) )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue