Skip to content
Snippets Groups Projects
Select Git revision
  • 6faf3d7e74c1afa07b075b539970e83574a7ff6a
  • develop default protected
  • congestioncontrol
  • merge-v-data-collection-spammer-0.8.2
  • WIP-merge-v-data-collection-spammer-0.8.2
  • merge-v-data-collection-spammer-0.7.7
  • tmp
  • test-masterpow-fixing
  • test-masterpow
  • test-echo
  • v-data-collection
  • v-data-collection-spammer
  • tmp-dump-spam-info
  • dump-msg-info-0.3.1
  • test-dump-message-info
  • spammer-exprandom
  • extra/tutorial
  • without_tipselection
  • hacking-docker-network
  • hacking-docker-network-0.2.3
  • master
  • v0.2.3
22 results

handshake.go

Blame
  • plugin.go 833 B
    package logger
    
    import (
    	"sync"
    
    	"github.com/iotaledger/goshimmer/plugins/config"
    	"github.com/iotaledger/hive.go/events"
    	"github.com/iotaledger/hive.go/logger"
    	"github.com/iotaledger/hive.go/node"
    )
    
    // PluginName is the name of the logger plugin.
    const PluginName = "Logger"
    
    var (
    	// plugin is the plugin instance of the logger plugin.
    	plugin *node.Plugin
    	once   sync.Once
    )
    
    // Plugin gets the plugin instance.
    func Plugin() *node.Plugin {
    	once.Do(func() {
    		plugin = node.NewPlugin(PluginName, node.Enabled)
    	})
    	return plugin
    }
    
    // Init triggers the Init event.
    func Init() {
    	plugin.Events.Init.Trigger(plugin)
    }
    
    func init() {
    	plugin = Plugin()
    
    	initFlags()
    
    	plugin.Events.Init.Attach(events.NewClosure(func(*node.Plugin) {
    		if err := logger.InitGlobalLogger(config.Node()); err != nil {
    			panic(err)
    		}
    	}))
    }