smartinspectpython.silogentry

Module: silogentry.py

Revision History

Date Version Description
2023/05/30 3.0.0.0 Initial Version.

@export
class SILogEntry(smartinspectpython.sipacket.SIPacket):

Represents the Log Entry packet type which is used for nearly all logging methods in the SISession class.

A Log Entry is the most important packet available in the SmartInspect concept. It is used for almost all logging methods in the SISession class, like, for example, SISession.LogMessage, SISession.LogObject or SISession.LogSql.

A Log Entry has several properties which describe its creation context (like a thread ID, time-stamp or host name) and other properties which specify the way the Console interprets this packet (like the viewer ID or the background color). Furthermore a Log Entry contains the actual data which will be displayed in the Console.

Threadsafety:

This class is not guaranteed to be thread-safe. However, instances of this class will normally only be used in the context of a single thread.

Initializes a new SILogEntry instance with a custom log entry type and custom viewer ID.

Arguments:
  • logEntryType (SILogEntryType): The type of the new Log Entry describes the way the Console interprets this packet. Please see the SILogEntryType enum for more information.
  • viewerId (SIViewerId): The viewer ID of the new Log Entry describes which viewer should be used in the Console when displaying the data of this Log Entry. Please see the SIViewerId enum for more information.
AppName: str

Gets the AppName property value.

Represents the application name of this Log Entry.

The application name of a Log Entry is usually set to the name of the application this Log Entry is created in. It will be empty in the SmartInspect Console when this property is set to null.

Gets the ColorBG property value.

Represents the background color of this Log Entry.

The background color of a Log Entry is normally set to the color of the session which sent this Log Entry.

Data: _io.BytesIO

Gets the Data property value.

This property contains an optional data stream of the Log Entry. This property can be null if this Log Entry does not contain additional data.

Important: Treat this stream as read-only. This means, modifying this stream in any way is not supported. Additionally, only pass streams which support seeking. Streams which do not support seeking cannot be used by this class.

DataLength: int

Returns the number of bytes used in the Data property. Note that this is the actual # of bytes used, and not the # of bytes allocated!

HasData: bool

Returns true if this packet contains optional data; otherwise, false.

HostName: str

Gets the HostName property value.

Represents the host name of this Log Entry.

The host name of a Log Entry is usually set to the name of the machine this Log Entry is sent from. It will be empty in the SmartInspect Console when this property is set to null.

Gets the LogEntryType property value.

Represents the type of this Log Entry.

The type of this Log Entry describes the way the Console interprets this packet. Please see the SILogEntryType enum for more information.

Overridden. Returns SIPacketType.LogEntry

ProcessId: int

Gets the ProcessId property value.

Represents the ID of the process this object was created in.

SessionName: str

Gets the SessionName property value.

Represents the session name of this Log Entry.

The session name of a Log Entry is normally set to the name of the session which sent this Log Entry. It will be empty in the SmartInspect Console when this property is set to null.

Size: int

Overridden. Returns the total occupied memory size of this Log Entry packet.

The total occupied memory size of this Log Entry is the size of memory occupied by all strings, the optional Data stream and any internal data structures of this Log Entry.

ThreadId: int

Gets the ThreadId property value.

Represents the ID of the thread this object was created in.

Timestamp: datetime.datetime

Gets the Timestamp property value.

Represents the time-stamp of this Log Entry object.

This property returns the creation time of this Log Entry object.

Title: str

Gets the Title property value.

Represents the title of this Log Entry.

The title of this Log Entry will be empty in the SmartInspect Console when this property is set to null.

Gets the ViewerId property value.

Represents the viewer ID of this Log Entry.

The viewer ID of the Log Entry describes which viewer should be used in the Console when displaying the data of this Log Entry. Please see the SIViewerId enum for more information.