Struct ArgumentInfo
Parsed Argument/Hole data. See https://messagetemplates.org/ for Holes
Inherited Members
Namespace: Unity.Logging
Assembly: Unity.Logging.dll
Syntax
public readonly struct ArgumentInfo
Constructors
ArgumentInfo(int, FixedString512Bytes, DestructingType, FixedString512Bytes, int)
Constructor of the Argument
Declaration
public ArgumentInfo(int index, FixedString512Bytes name, ArgumentInfo.DestructingType destructingType, FixedString512Bytes format, int alignment)
Parameters
Type | Name | Description |
---|---|---|
int | index | Integer in the hole, like {0} or {42}, if not set see Name |
Fixed |
name | Name of the hole, like or default if Index is used instead |
Argument |
destructingType | @, $ or default |
Fixed |
format | Format - custom string after : |
int | alignment | Integer after comma, before : |
Fields
Alignment
Alignment that is specified after ','
Declaration
public readonly int Alignment
Field Value
Type | Description |
---|---|
int |
BuiltInLevelId
Builtin code for the level context argument
Declaration
public const int BuiltInLevelId = -101
Field Value
Type | Description |
---|---|
int |
BuiltInMessage
Builtin code for the message context argument
Declaration
public const int BuiltInMessage = -102
Field Value
Type | Description |
---|---|
int |
BuiltInNewLine
Builtin code for the newline context argument
Declaration
public const int BuiltInNewLine = -104
Field Value
Type | Description |
---|---|
int |
BuiltInProperties
Builtin code for the properties context argument
Declaration
public const int BuiltInProperties = -105
Field Value
Type | Description |
---|---|
int |
BuiltInStackTrace
Builtin code for the stacktrace context argument
Declaration
public const int BuiltInStackTrace = -103
Field Value
Type | Description |
---|---|
int |
BuiltInTimestampId
Builtin code for the timestamp context argument
Declaration
public const int BuiltInTimestampId = -100
Field Value
Type | Description |
---|---|
int |
Destructing
Declaration
public readonly ArgumentInfo.DestructingType Destructing
Field Value
Type | Description |
---|---|
Argument |
Format
Format that is specified after ':'
Declaration
public readonly FixedString512Bytes Format
Field Value
Type | Description |
---|---|
Fixed |
Index
Indexed hole (if no Name was specified)
Declaration
public readonly int Index
Field Value
Type | Description |
---|---|
int |
IsValidByte
Non-Zero if created
Declaration
public readonly byte IsValidByte
Field Value
Type | Description |
---|---|
byte |
Name
Name of the hole
Declaration
public readonly FixedString512Bytes Name
Field Value
Type | Description |
---|---|
Fixed |
Type
Argument
Declaration
public readonly ArgumentInfo.HoleType Type
Field Value
Type | Description |
---|---|
Argument |
Properties
IsBuiltIn
True if the Argument
Declaration
public bool IsBuiltIn { get; }
Property Value
Type | Description |
---|---|
bool |
IsValid
True if created
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Number(int)
Create a hole from a number (index)
Declaration
public static ArgumentInfo Number(int i)
Parameters
Type | Name | Description |
---|---|---|
int | i | index to use |
Returns
Type | Description |
---|---|
Argument |
ArgumentInfo with Index == i |
ParseArgument(byte*, int, in ParseSegment)
Parses Argument
Declaration
public static ArgumentInfo ParseArgument(byte* rawMsgBuffer, int rawMsgBufferLength, in ParseSegment currArgSegment)
Parameters
Type | Name | Description |
---|---|---|
byte* | rawMsgBuffer | Pointer to UTF8 string |
int | rawMsgBufferLength | Full length of the UTF8 string |
Parse |
currArgSegment | Segment to parse inside the UTF8 string |
Returns
Type | Description |
---|---|
Argument |
Parsed ArgumentInfo or default if error occured |
RetrieveContextArgumentIndex(in byte*, in ParseSegment, bool)
Returns an index of the context argument to use in WriteMessage or builtin code
Declaration
public static int RetrieveContextArgumentIndex(in byte* rawBuffer, in ParseSegment argSlotSegment, bool isThisTemplate)
Parameters
Type | Name | Description |
---|---|---|
byte* | rawBuffer | Pointer to argument UTF8 string |
Parse |
argSlotSegment | Segment inside the UTF8 string |
bool | isThisTemplate | True if this is a template (so is valid) |
Returns
Type | Description |
---|---|
int | Index of the context argument to use in WriteMessage or builtin code |