Class

ContractLogger

ContractLogger(context, conf, ctx)

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

View Source contracts/logging.ts, line 4

Example
```typescript
// In a Fabric chaincode contract
import { ContractLogger } from '@decaf-ts/for-fabric';

export class MyContract extends Contract {
  

Extends

  • MiniLogger

Members

# logger

The underlying Fabric logger instance

.

The underlying Fabric logger instance

View Source contracts/logging.ts, line 38

Logger

# protected logger

The underlying Fabric logger instance

.

The underlying Fabric logger instance

View Source contracts/logging.ts, line 109

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

View Source contracts/logging.ts, line 120

void