// init initializes global logger, which logs debug level messages to stdout.
516388
func init() {
	log = logger.New()
	log.Out = os.Stdout
	log.Level = logger.DebugLevel
}
609414
func (c *Cmd) Init() {
	c.Lock()
	defer c.Unlock()

	c.exitCh = make(chan struct{})
}
48156
func (t *ObjectTree) Init(flags byte) *ObjectTree {
	t.Tree.Init(objectCompare, flags)
	return t
}
960270
func (n *NoneParser) Init(b *bytes.Buffer) bool {
	m := make(map[string]interface{})
	n.metadata = NewMetadata(m)
	n.markdown = bytes.NewBuffer(b.Bytes())

	return true
}
1078155
func (d *decoder) init(in *bitReader, dt []decSymbol, tableLog uint8) {
	d.dt = dt
	d.br = in
	d.state = uint16(in.getBits(tableLog))
}
501358
func (plugin *ExamplePlugin) Init() (err error) {
	exampleString := "example"
	exampleNum := 15

	// Set log level which logs only entries with current severity or above
	plugin.Log.SetLevel(logging.WarnLevel)  // warn, error, panic, fatal
	plugin.Log.SetLevel(logging.InfoLevel)  // info, warn, error, panic, fatal - default log level
	plugin.Log.SetLevel(logging.DebugLevel) // everything

	// Basic logger options
	plugin.Log.Print("----------- Log examples -----------")
	plugin.Log.Printf("Print with format specifier. String: %s, Digit: %d, Value: %v", exampleString, exampleNum, plugin)

	// Format also available for all 6 levels of log levels
	plugin.Log.Debug("Debug log example: Debugging information")
	plugin.Log.Info("Info log example: Something informative")
	plugin.Log.Warn("Warn log example: Something unexpected, warning")
	plugin.Log.Error("Error log example: Failure without exit")
	plugin.showPanicLog()
	//log.Fatal("Bye") calls os.Exit(1) after logging

	// Log with field - automatically adds timestamp
	plugin.Log.WithField("exampleString", exampleString).Info("Info log with field example")
	// For multiple fields
	plugin.Log.WithFields(map[string]interface{}{"exampleString": exampleString, "exampleNum": exampleNum}).Info("Info log with field example string and num")

	// Custom (child) logger with name
	childLogger := plugin.Log.NewLogger("childLogger")
	childLogger.Infof("Log using named logger with name: %v", childLogger.GetName())
	childLogger.Debug("Debug log using childLogger!")

	childLogger2 := plugin.Log.NewLogger("childLogger2")
	childLogger2.Debug("Debug log using childLogger2!")

	return nil
}
267376
func init() {
	// use all cpus in the system for concurrency
	runtime.GOMAXPROCS(runtime.NumCPU())

	log.SetOutput(os.Stdout)

	flag.Parse()

	if *showUsage {
		flag.Usage()
		os.Exit(0)
	}

	printParams()

	var err error
	Client, err = as.NewClient(*Host, *Port)
	if err != nil {
		PanicOnError(err)
	}
}
277553
func (c *infoCommand) Init(args []string) (err error) {
	c.Username, err = cmd.ZeroOrOneArgs(args)
	return err
}
347960
func (c *configCommand) Init(args []string) error {
	switch len(args) {
	case 0:
		return c.handleZeroArgs()
	case 1:
		return c.handleOneArg(args[0])
	default:
		return c.handleArgs(args)
	}
}
1117462
func (s *Service) initLogger() {
	log.SetLevel(s.options.LogSeverity.S)
	// If LogFormatter is specified then Log is ignored.
	if s.options.LogFormatter != nil {
		log.SetOutput(os.Stdout)
		log.SetFormatter(s.options.LogFormatter)
		return
	}
	if s.options.Log == "console" {
		log.SetOutput(os.Stdout)
		log.SetFormatter(&log.TextFormatter{})
		return
	}
	var err error
	if s.options.Log == "syslog" {
		var devNull *os.File
		devNull, err = os.OpenFile("/dev/null", os.O_WRONLY, 0)
		if err == nil {
			var hook *logrus_syslog.SyslogHook
			hook, err = logrus_syslog.NewSyslogHook("udp", "127.0.0.1:514", syslog.LOG_INFO|syslog.LOG_MAIL, "vulcand")
			if err == nil {
				log.SetOutput(devNull)
				log.SetFormatter(&log.TextFormatter{DisableColors: true})
				log.AddHook(hook)
				return
			}
		}
	}
	if s.options.Log == "json" {
		log.SetOutput(os.Stdout)
		log.SetFormatter(&log.JSONFormatter{})
		return
	}
	if s.options.Log == "logstash" {
		log.SetOutput(os.Stdout)
		log.SetFormatter(&logrus_logstash.LogstashFormatter{Fields: log.Fields{"type": "logs"}})
		return
	}
	log.SetOutput(os.Stdout)
	log.SetFormatter(&log.TextFormatter{})
	log.Warnf("Failed to initialized logger. Fallback to default: logger=%s, err=(%s)", s.options.Log, err)
}
1080843
func InitLogger() logger.Logger {
	lvl := logger.ERROR
	if ll := os.Getenv("LOG_LEVEL"); ll != "" {
		lvl = logger.ParseLevel(ll)
	}

	return logger.New(log.New(os.Stdout, "", 0), lvl)
}
459068
func (r *copyReader) init() {
	_, r.rerr = r.WriteTo(&r.rbuf)
}
122576
func init() {
	addrmgr.UseLogger(amgrLog)
	connmgr.UseLogger(cmgrLog)
	database.UseLogger(bcdbLog)
	blockchain.UseLogger(chanLog)
	indexers.UseLogger(indxLog)
	mining.UseLogger(minrLog)
	cpuminer.UseLogger(minrLog)
	peer.UseLogger(peerLog)
	txscript.UseLogger(scrpLog)
	netsync.UseLogger(syncLog)
	mempool.UseLogger(txmpLog)
}
525775
func (c *Client) Init() error {
	stdin, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		return errors.Annotate(err, "failed to read stdin").Err()
	}

	c.InitBuild = &pb.Build{}
	if err := proto.Unmarshal(stdin, c.InitBuild); err != nil {
		return errors.Annotate(err, "failed to parse buildbucket.v2.Build from stdin").Err()
	}

	if c.Logdog, err = bootstrap.Get(); err != nil {
		return err
	}

	buildTimestamp := c.BuildTimestamp
	if buildTimestamp.IsZero() {
		buildTimestamp = time.Now()
	}

	c.buildStream, err = c.Logdog.Client.NewStream(streamproto.Flags{
		Name:        streamproto.StreamNameFlag(BuildStreamName),
		Type:        streamproto.StreamType(logpb.StreamType_DATAGRAM),
		ContentType: protoutil.BuildMediaType,
		Timestamp:   clockflag.Time(buildTimestamp),
	})
	return err
}
402864
func (h *multiHandler) Init() error {
	for _, handler := range h.handlers {
		if err := handler.Init(); err != nil {
			return err
		}
	}
	return nil
}
343527
func (s *StringCodeGenerator) Init() {
	s.Position = vm.Position{State: vm.NewState()}
	s.Lines = []string{"(Exported by gocnc)", "G21G90\n"}
}
621521
func (w *FileLogWriter) Init(config map[string]interface{}) error {
	if config == nil {
		return errors.New("config can not be empty")
	}
	if filename, ok := config["filename"]; !ok || len(filename.(string)) == 0 {
		return errors.New("config must have filename")
	}
	conf, err := json.Marshal(config)
	if err != nil {
		return err
	}
	err = json.Unmarshal(conf, w)
	if err != nil {
		return err
	}
	return w.startLogger()
}