Constructor
# new ContractLogger(context, conf, ctx)
Adapts the standard logging interface to work with Fabric's chaincode context
Logger implementation for Fabric chaincode contracts
Parameters:
| Name | Type | Description |
|---|---|---|
context |
string
|
The logging context name |
conf |
Partial.<LoggingConfig>
|
undefined
|
Optional logging configuration |
ctx |
Ctx
|
The Fabric chaincode context |
Example
```typescript
// In a Fabric chaincode contract
import { ContractLogger } from '@decaf-ts/for-fabric';
export class MyContract extends Contract {
Extends
- MiniLogger
Members
Methods
# protected log(level, msg, stackopt) → {void}
Overrides the base log method to use the Fabric context's logger
Logs a message at the specified level
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
level |
LogLevel
|
The log level |
|
msg |
StringLike
|
Error
|
The message to log |
|
stack |
Error
|
<optional> |
Optional stack trace for errors |
void