glg.go
func New() *Glg {

	g := &Glg{
		levelCounter: new(uint32),
		buffer: sync.Pool{
			New: func() interface{} {
				return bytes.NewBuffer(make([]byte, 0, bufferSize))
			},
		},
	}

	atomic.StoreUint32(g.levelCounter, uint32(FATAL))

	for lev, log := range map[LEVEL]*logger{
		// standard out
		PRINT: {
			std:     os.Stdout,
			color:   Colorless,
			isColor: true,
			mode:    STD,
		},
		LOG: {
			std:     os.Stdout,
			color:   Colorless,
			isColor: true,
			mode:    STD,
		},
		INFO: {
			std:     os.Stdout,
			color:   Green,
			isColor: true,
			mode:    STD,
		},
		DEBG: {
			std:     os.Stdout,
			color:   Purple,
			isColor: true,
			mode:    STD,
		},
		OK: {
			std:     os.Stdout,
			color:   Cyan,
			isColor: true,
			mode:    STD,
		},
		WARN: {
			std:     os.Stdout,
			color:   Orange,
			isColor: true,
			mode:    STD,
		},
		// error out
		ERR: {
			std:     os.Stderr,
			color:   Red,
			isColor: true,
			mode:    STD,
		},
		FAIL: {
			std:     os.Stderr,
			color:   Red,
			isColor: true,
			mode:    STD,
		},
		FATAL: {
			std:     os.Stderr,
			color:   Red,
			isColor: true,
			mode:    STD,
		},
	} {
		log.tag = lev.String()
		log.updateMode()
		g.logger.Store(lev, log)
	}

	return g
}
func New() *Glg {

	g := &Glg{
		levelCounter: new(uint32),
		buffer: sync.Pool{
			New: func() interface{} {
				return bytes.NewBuffer(make([]byte, 0, bufferSize))
			},
		},
	}

	atomic.StoreUint32(g.levelCounter, uint32(FATAL))

	for lev, log := range map[LEVEL]*logger{
		// standard out
		PRINT: {
			std:     os.Stdout,
			color:   Colorless,
			isColor: true,
			mode:    STD,
		},
		LOG: {
			std:     os.Stdout,
			color:   Colorless,
			isColor: true,
			mode:    STD,
		},
		INFO: {
			std:     os.Stdout,
			color:   Green,
			isColor: true,
			mode:    STD,
		},
		DEBG: {
			std:     os.Stdout,
			color:   Purple,
			isColor: true,
			mode:    STD,
		},
		OK: {
			std:     os.Stdout,
			color:   Cyan,
			isColor: true,
			mode:    STD,
		},
		WARN: {
			std:     os.Stdout,
			color:   Orange,
			isColor: true,
			mode:    STD,
		},
		// error out
		ERR: {
			std:     os.Stderr,
			color:   Red,
			isColor: true,
			mode:    STD,
		},
		FAIL: {
			std:     os.Stderr,
			color:   Red,
			isColor: true,
			mode:    STD,
		},
		FATAL: {
			std:     os.Stderr,
			color:   Red,
			isColor: true,
			mode:    STD,
		},
	} {
		log.tag = lev.String()
		log.updateMode()
		g.logger.Store(lev, log)
	}

	return g
}
// New returns plain glg instance