acflogger

package
v0.0.0-...-b3cf803 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 3 Imported by: 0

README

Custom Logger

Starting Shim version 2.0 the shim.NewLogger is NOT supported. Developer of the chaincode can use any standard logger of their choice.

ACloudFan custom logger

This is a minimilistic logger implementation that can be used from the chaincode. Please note this is NOT production grade and built for demostrating the logging setup for chaincode.

Refer to the chaincode at $GOPATH/src/acflogger

Standalone Testing

Testing

  1. Refer to the code v2/token.go

  2. Terminal#1 dev-init.sh

  3. Terminal#2 . set-chain.sh acme chain.sh -p token/v2 chain.sh install chain.sh approveformmyorg chain.sh commit

  4. Switch to Terminal#1 & start logging for the chaincode container cc-logs.sh -t 10 -f

  5. Execute the invoke in Terminal#2 chain.sh init chain.sh invoke <<Check messages in Terminal#1>>

  6. Change chaincode Logging level in network/config/core.yaml

  7. Stop & Start the network

  8. Check the logs cc-logs.sh -t 10 -f

  9. Execute the invoke in Terminal#2 chain.sh init chain.sh invoke <<Check messages in Terminal#1>>

Documentation

Index

Constants

View Source
const DEBUG = 0

DEBUG Logging level

View Source
const ERROR = 4

ERROR Logging Level

View Source
const FATAL = 5

FATAL logging Level

View Source
const INFO = 1

INFO Logging level

View Source
const NOTICE = 2

NOTICE Logging Level

View Source
const WARNING = 3

WARNING Logging Level

Variables

This section is empty.

Functions

This section is empty.

Types

type AcfLogger

type AcfLogger struct {
	// contains filtered or unexported fields
}

AcfLogger structure

func NewLogger

func NewLogger() *AcfLogger

NewLogger creates an instance

func (*AcfLogger) Debug

func (logger *AcfLogger) Debug(s string)

Debug message printing

func (*AcfLogger) Error

func (logger *AcfLogger) Error(s string)

Error message printing

func (*AcfLogger) Fatal

func (logger *AcfLogger) Fatal(s string)

Fatal message printing

func (*AcfLogger) Info

func (logger *AcfLogger) Info(s string)

Info message printing

func (*AcfLogger) Notice

func (logger *AcfLogger) Notice(s string)

Notice message printing

func (*AcfLogger) Warning

func (logger *AcfLogger) Warning(s string)

Warning message printing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL