-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Log.Classes
Represents a standard log collection using LogRecord entries.
public class Log : DiGi.Log.Classes.Log<DiGi.Log.Classes.LogRecord>Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → DiGi.Log.Classes.Log<LogRecord> → Log
Initializes a new instance of the Log class.
public Log();Initializes a new instance of the Log class by cloning an existing log object.
public Log(DiGi.Log.Classes.Log? log);log Log
The source log object to clone.
Initializes a new instance of the Log class with a specified collection of log records.
public Log(System.Collections.Generic.IEnumerable<DiGi.Log.Classes.LogRecord>? logRecords);logRecords System.Collections.Generic.IEnumerable<LogRecord>
The initial collection of log records to populate the log.
Initializes a new instance of the Log class from a JSON object.
public Log(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object containing log data.
Adds a new log record to the collection after cloning it.
public DiGi.Log.Classes.LogRecord? Add(DiGi.Log.Classes.LogRecord? logRecord);logRecord LogRecord
The log record to add.
LogRecord
The added log record, or null if the input was null.
Creates and adds a new log record based on the specified type and format.
public DiGi.Log.Classes.LogRecord? Add(DiGi.Log.Enums.LogRecordType logRecordType, string format, params object[] values);logRecordType LogRecordType
The type of the log record.
format System.String
The format string for the log message.
values System.Object[]
The values to be formatted into the message.
LogRecord
The created and added log record.
Adds a range of log records to the collection.
public System.Collections.Generic.List<DiGi.Log.Classes.LogRecord>? AddRange(System.Collections.Generic.IEnumerable<DiGi.Log.Classes.LogRecord>? logRecords);logRecords System.Collections.Generic.IEnumerable<LogRecord>
The collection of log records to add.
System.Collections.Generic.List<LogRecord>
A list of successfully added log records, or null if the input was null.
Creates a shallow copy of the current log instance.
public override DiGi.Core.Interfaces.ISerializableObject Clone();Implements Clone()
DiGi.Core.Interfaces.ISerializableObject
A cloned DiGi.Core.Interfaces.ISerializableObject representing the log.
Represents a base collection of log records.
public abstract class Log<T> : DiGi.Core.Classes.SerializableObject, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
where T : DiGi.Log.Interfaces.ILogRecordT
The type of log record, which must implement ILogRecord.
Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Log<T>
Derived
↳ Log
Implements System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
Initializes a new instance of the Log<T> class.
public Log();Initializes a new instance of the Log<T> class by cloning an existing log object.
public Log(DiGi.Log.Classes.Log<T>? log);The source log object to clone.
Initializes a new instance of the Log<T> class with a specified collection of log records.
public Log(System.Collections.Generic.IEnumerable<T>? logRecords);logRecords System.Collections.Generic.IEnumerable<T>
The initial collection of log records to populate the log.
Initializes a new instance of the Log<T> class from a JSON object.
public Log(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object containing log data.
The internal list of log records.
protected List<T> logRecords;System.Collections.Generic.List<T>
Returns an enumerator that iterates through the collection of log records.
public System.Collections.Generic.IEnumerator<T> GetEnumerator();Implements GetEnumerator(), GetEnumerator()
System.Collections.Generic.IEnumerator<T>
A typed enumerator for T.
Returns a string representation of all log records, separated by environment new lines.
public override string? ToString();System.String
A concatenated string of all log records, or null if the record list is null.
Writes the contents of the log to a specified file path.
public bool Write(string? path);path System.String
The destination file path.
System.Boolean
True if the write operation was successful; otherwise, false.
Returns an enumerator that iterates through the collection of log records.
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator();Implements GetEnumerator()
Represents a log record entry containing timestamp, identification, type, and message text.
public class LogRecord : DiGi.Core.Classes.SerializableObject, DiGi.Log.Interfaces.ILogRecord, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObjectInheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → LogRecord
Implements ILogRecord, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject, DiGi.Core.Interfaces.IObject
Initializes a new instance of the LogRecord class by copying an existing record.
public LogRecord(DiGi.Log.Classes.LogRecord? logRecord);logRecord LogRecord
The source log record to copy from.
Initializes a new instance of the LogRecord class using current UTC time and no identifier.
public LogRecord(DiGi.Log.Enums.LogRecordType logRecordType, string? text);logRecordType LogRecordType
The type or severity of the log record.
text System.String
The descriptive text of the log message.
Initializes a new instance of the LogRecord class using the current UTC time.
public LogRecord(string? id, DiGi.Log.Enums.LogRecordType logRecordType, string? text);The unique identifier for the record.
logRecordType LogRecordType
The type or severity of the log record.
text System.String
The descriptive text of the log message.
Initializes a new instance of the LogRecord class without an identifier.
public LogRecord(System.DateTime dateTime, DiGi.Log.Enums.LogRecordType logRecordType, string? text);dateTime System.DateTime
The timestamp of the log entry.
logRecordType LogRecordType
The type or severity of the log record.
text System.String
The descriptive text of the log message.
Initializes a new instance of the LogRecord class with all specified values.
public LogRecord(System.DateTime dateTime, string? id, DiGi.Log.Enums.LogRecordType logRecordType, string? text);dateTime System.DateTime
The timestamp of the log entry.
The unique identifier for the record.
logRecordType LogRecordType
The type or severity of the log record.
text System.String
The descriptive text of the log message.
Initializes a new instance of the LogRecord class from a JSON object.
public LogRecord(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object containing record data.
Gets the timestamp when the log record was created.
public System.DateTime DateTime { get; }Implements DateTime
Gets the unique identifier of the log record.
public string? Id { get; }Implements Id
Gets the type or severity level of the log record.
public DiGi.Log.Enums.LogRecordType LogRecordType { get; }Implements LogRecordType
Gets the message text associated with the log record.
public string? Text { get; }Implements Text
Creates a clone of the current log record.
public override DiGi.Core.Interfaces.ISerializableObject? Clone();Implements Clone()
DiGi.Core.Interfaces.ISerializableObject
A new DiGi.Core.Interfaces.ISerializableObject instance that is a copy of this record.
Returns a hash code for the current log record based on its string representation.
public override int GetHashCode();System.Int32
An integer hash code.
Returns a string representation of the log record, formatted with tabs.
public override string ToString();System.String
A formatted string containing the date, ID (if available), type description, and text.
Attribute used to define properties for a log record field.
public class LogRecordProperties : System.AttributeInheritance System.Object → System.Attribute → LogRecordProperties
Initializes a new instance of the LogRecordProperties class.
public LogRecordProperties(DiGi.Log.Enums.LogRecordType logRecordType, string? text);logRecordType LogRecordType
The type of the log record.
text System.String
The descriptive text associated with the log record.
Initializes a new instance of the LogRecordProperties class.
public LogRecordProperties(string? id, DiGi.Log.Enums.LogRecordType logRecordType, string? text);The unique identifier for the log record property.
logRecordType LogRecordType
The type of the log record.
text System.String
The descriptive text associated with the log record.
Gets the unique identifier for the log record property.
public string? Id { get; }Gets the type of the log record.
public DiGi.Log.Enums.LogRecordType LogRecordType { get; }Gets the descriptive text associated with the log record.
public string? Text { get; }