ClassName constructor

ClassName(
  1. String name, {
  2. String? instanceHash,
})

Renders a class name with optional instance hash.

The instance hash helps distinguish multiple instances of the same class in logs, which is useful for tracking object lifecycles or debugging concurrent operations.

Example output: UserService or UserService@a1b2c3d4

Use ClassName.fromRecord to automatically extract class name and hash from a LogRecord.

Implementation

ClassName(this.name, {this.instanceHash});