1
0
Fork 0

Fix up all logs to use nameof() instead of hardcoded string

This commit is contained in:
ivan tkachenko 2025-07-30 14:51:08 +03:00
parent ce437aa86c
commit 2ef0fc3bd9
1 changed files with 7 additions and 6 deletions

View File

@ -476,7 +476,7 @@ namespace MuzikaGromche
var rwi = new RandomWeightedIndex(weights); var rwi = new RandomWeightedIndex(weights);
var trackId = rwi.GetRandomWeightedIndex(seed); var trackId = rwi.GetRandomWeightedIndex(seed);
var track = tracks[trackId]; var track = tracks[trackId];
Debug.Log($"Seed is {seed}, chosen track is \"{track.Name}\", #{trackId} of {rwi}"); Debug.Log($"{nameof(MuzikaGromche)} Seed is {seed}, chosen track is \"{track.Name}\", #{trackId} of {rwi}");
return tracks[trackId]; return tracks[trackId];
} }
@ -1023,7 +1023,7 @@ namespace MuzikaGromche
loopOffsetBeat = loopTimestamp.Beat; loopOffsetBeat = loopTimestamp.Beat;
var events = GetEvents(loopOffsetSpan, windUpOffsetTimestamp); var events = GetEvents(loopOffsetSpan, windUpOffsetTimestamp);
#if DEBUG #if DEBUG
Debug.Log($"MuzikaGromche looping(loop)={loopOffsetIsLooping} looping(windUp)={windUpOffsetIsLooping} Loop={loopOffsetSpan} WindUp={windUpOffsetTimestamp} events={string.Join(",", events)}"); Debug.Log($"{nameof(MuzikaGromche)} looping? {(loopOffsetIsLooping ? 'X' : '_')}{(windUpOffsetIsLooping ? 'X' : '_')} Loop={loopOffsetSpan} WindUp={windUpOffsetTimestamp} events={string.Join(",", events)}");
#endif #endif
return events; return events;
} }
@ -1085,7 +1085,8 @@ namespace MuzikaGromche
#if DEBUG && false #if DEBUG && false
var color = ColorFromPaletteAtTimestamp(timestamp); var color = ColorFromPaletteAtTimestamp(timestamp);
Debug.LogFormat("MuzikaGromche t={0,10:N4} d={1,7:N4} Start[{2}{3,8:N4} ==0f? {4}] Loop[{5}{6,8:N4}] norm={7,6:N4} beat={8,7:N4} color={9}", Debug.LogFormat("{0} t={1,10:N4} d={2,7:N4} Start[{3}{4,8:N4} zero? {5}] Loop[{6}{7,8:N4}] norm={8,6:N4} beat={9,7:N4} color={10}",
nameof(MuzikaGromche),
Time.realtimeSinceStartup, Time.deltaTime, Time.realtimeSinceStartup, Time.deltaTime,
(start.isPlaying ? '+' : ' '), start.time, (start.time == 0f ? 'Y' : 'n'), (start.isPlaying ? '+' : ' '), start.time, (start.time == 0f ? 'Y' : 'n'),
(loop.isPlaying ? '+' : ' '), loop.time, (loop.isPlaying ? '+' : ' '), loop.time,
@ -1822,7 +1823,7 @@ namespace MuzikaGromche
} }
__instance.farAudio.Play(); __instance.farAudio.Play();
Debug.Log($"Playing start music: maxDistance: {__instance.farAudio.maxDistance}, minDistance: {__instance.farAudio.minDistance}, volume: {__instance.farAudio.volume}, spread: {__instance.farAudio.spread}"); Debug.Log($"{nameof(MuzikaGromche)} Playing start music: maxDistance: {__instance.farAudio.maxDistance}, minDistance: {__instance.farAudio.minDistance}, volume: {__instance.farAudio.volume}, spread: {__instance.farAudio.spread}");
} }
if (__instance.previousState != 2 && __state.previousState == 2) if (__instance.previousState != 2 && __state.previousState == 2)
@ -1845,8 +1846,8 @@ namespace MuzikaGromche
__instance.creatureVoice.clip = Plugin.CurrentTrack.LoadedLoop; __instance.creatureVoice.clip = Plugin.CurrentTrack.LoadedLoop;
__instance.creatureVoice.PlayDelayed(delay); __instance.creatureVoice.PlayDelayed(delay);
Debug.Log($"Start length: {Plugin.CurrentTrack.LoadedStart.length}; played time: {time}"); Debug.Log($"{nameof(MuzikaGromche)} Start length: {Plugin.CurrentTrack.LoadedStart.length}; played time: {time}");
Debug.Log($"Playing loop music: maxDistance: {__instance.creatureVoice.maxDistance}, minDistance: {__instance.creatureVoice.minDistance}, volume: {__instance.creatureVoice.volume}, spread: {__instance.creatureVoice.spread}, in seconds: {delay}"); Debug.Log($"{nameof(MuzikaGromche)} Playing loop music: maxDistance: {__instance.creatureVoice.maxDistance}, minDistance: {__instance.creatureVoice.minDistance}, volume: {__instance.creatureVoice.volume}, spread: {__instance.creatureVoice.spread}, in seconds: {delay}");
} }
// Manage the timeline: switch color of the lights according to the current playback/beat position. // Manage the timeline: switch color of the lights according to the current playback/beat position.