Debug.Log Extensions
Documentation (1.1.9)

◆ LogError() [14/16]

static void Debug.LogError ( [NotNull] string  prefix,
[NotNull] params Expression< Func< object >>[]  classMembers 
)
static

Logs an error message to the Console consisting of a prefix text string followed by the names and values of classMembers zero or more class members.

A comma will be used for the separator character with shorter messages and a line break with longer messages.

public IEnumerator PlaySound(float delay, AudioId audioId)
{
if(delay < 0f)
{
Debug.LogError("[Audio] PlaySound called with an invalid delay - ", ()=>delay, ()=>audioId);
delay = 0f;
}
yield return new WaitForSeconds(delay);
audioController.Play(audioId);
}
static void LogError([CanBeNull]string message)
Logs an error message to the Console.
Definition: Debug.cs:2527
Extended version of the built-in Debug class with additional methods to ease debugging while developi...
Definition: Debug.cs:34
Parameters
prefixPrefix text for the message.
classMembersExpressions pointing to class members whose names and values will be included in the message.