12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181 |
- package glog
- import (
- "bufio"
- "bytes"
- "errors"
- "fmt"
- flag "github.com/chrislusf/seaweedfs/weed/util/fla9"
- "io"
- stdLog "log"
- "os"
- "path/filepath"
- "runtime"
- "strconv"
- "strings"
- "sync"
- "sync/atomic"
- "time"
- )
- type severity int32
- const (
- infoLog severity = iota
- warningLog
- errorLog
- fatalLog
- numSeverity = 4
- )
- const severityChar = "IWEF"
- var severityName = []string{
- infoLog: "INFO",
- warningLog: "WARNING",
- errorLog: "ERROR",
- fatalLog: "FATAL",
- }
- func (s *severity) get() severity {
- return severity(atomic.LoadInt32((*int32)(s)))
- }
- func (s *severity) set(val severity) {
- atomic.StoreInt32((*int32)(s), int32(val))
- }
- func (s *severity) String() string {
- return strconv.FormatInt(int64(*s), 10)
- }
- func (s *severity) Get() interface{} {
- return *s
- }
- func (s *severity) Set(value string) error {
- var threshold severity
-
- if v, ok := severityByName(value); ok {
- threshold = v
- } else {
- v, err := strconv.Atoi(value)
- if err != nil {
- return err
- }
- threshold = severity(v)
- }
- logging.stderrThreshold.set(threshold)
- return nil
- }
- func severityByName(s string) (severity, bool) {
- s = strings.ToUpper(s)
- for i, name := range severityName {
- if name == s {
- return severity(i), true
- }
- }
- return 0, false
- }
- type OutputStats struct {
- lines int64
- bytes int64
- }
- func (s *OutputStats) Lines() int64 {
- return atomic.LoadInt64(&s.lines)
- }
- func (s *OutputStats) Bytes() int64 {
- return atomic.LoadInt64(&s.bytes)
- }
- var Stats struct {
- Info, Warning, Error OutputStats
- }
- var severityStats = [numSeverity]*OutputStats{
- infoLog: &Stats.Info,
- warningLog: &Stats.Warning,
- errorLog: &Stats.Error,
- }
- type Level int32
- func (l *Level) get() Level {
- return Level(atomic.LoadInt32((*int32)(l)))
- }
- func (l *Level) set(val Level) {
- atomic.StoreInt32((*int32)(l), int32(val))
- }
- func (l *Level) String() string {
- return strconv.FormatInt(int64(*l), 10)
- }
- func (l *Level) Get() interface{} {
- return *l
- }
- func (l *Level) Set(value string) error {
- v, err := strconv.Atoi(value)
- if err != nil {
- return err
- }
- logging.mu.Lock()
- defer logging.mu.Unlock()
- logging.setVState(Level(v), logging.vmodule.filter, false)
- return nil
- }
- type moduleSpec struct {
- filter []modulePat
- }
- type modulePat struct {
- pattern string
- literal bool
- level Level
- }
- func (m *modulePat) match(file string) bool {
- if m.literal {
- return file == m.pattern
- }
- match, _ := filepath.Match(m.pattern, file)
- return match
- }
- func (m *moduleSpec) String() string {
-
- logging.mu.Lock()
- defer logging.mu.Unlock()
- var b bytes.Buffer
- for i, f := range m.filter {
- if i > 0 {
- b.WriteRune(',')
- }
- fmt.Fprintf(&b, "%s=%d", f.pattern, f.level)
- }
- return b.String()
- }
- func (m *moduleSpec) Get() interface{} {
- return nil
- }
- var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N")
- func (m *moduleSpec) Set(value string) error {
- var filter []modulePat
- for _, pat := range strings.Split(value, ",") {
- if len(pat) == 0 {
-
- continue
- }
- patLev := strings.Split(pat, "=")
- if len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 {
- return errVmoduleSyntax
- }
- pattern := patLev[0]
- v, err := strconv.Atoi(patLev[1])
- if err != nil {
- return errors.New("syntax error: expect comma-separated list of filename=N")
- }
- if v < 0 {
- return errors.New("negative value for vmodule level")
- }
- if v == 0 {
- continue
- }
-
- filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)})
- }
- logging.mu.Lock()
- defer logging.mu.Unlock()
- logging.setVState(logging.verbosity, filter, true)
- return nil
- }
- func isLiteral(pattern string) bool {
- return !strings.ContainsAny(pattern, `\*?[]`)
- }
- type traceLocation struct {
- file string
- line int
- }
- func (t *traceLocation) isSet() bool {
- return t.line > 0
- }
- func (t *traceLocation) match(file string, line int) bool {
- if t.line != line {
- return false
- }
- if i := strings.LastIndex(file, "/"); i >= 0 {
- file = file[i+1:]
- }
- return t.file == file
- }
- func (t *traceLocation) String() string {
-
- logging.mu.Lock()
- defer logging.mu.Unlock()
- return fmt.Sprintf("%s:%d", t.file, t.line)
- }
- func (t *traceLocation) Get() interface{} {
- return nil
- }
- var errTraceSyntax = errors.New("syntax error: expect file.go:234")
- func (t *traceLocation) Set(value string) error {
- if value == "" {
-
- t.line = 0
- t.file = ""
- }
- fields := strings.Split(value, ":")
- if len(fields) != 2 {
- return errTraceSyntax
- }
- file, line := fields[0], fields[1]
- if !strings.Contains(file, ".") {
- return errTraceSyntax
- }
- v, err := strconv.Atoi(line)
- if err != nil {
- return errTraceSyntax
- }
- if v <= 0 {
- return errors.New("negative or zero value for level")
- }
- logging.mu.Lock()
- defer logging.mu.Unlock()
- t.line = v
- t.file = file
- return nil
- }
- type flushSyncWriter interface {
- Flush() error
- Sync() error
- io.Writer
- }
- func init() {
- flag.BoolVar(&logging.toStderr, "logtostderr", false, "log to standard error instead of files")
- flag.BoolVar(&logging.alsoToStderr, "alsologtostderr", true, "log to standard error as well as files")
- flag.Var(&logging.verbosity, "v", "log levels [0|1|2|3|4], default to 0")
- flag.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr")
- flag.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging")
- flag.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace")
-
- logging.stderrThreshold = errorLog
- logging.setVState(0, nil, false)
- go logging.flushDaemon()
- }
- func Flush() {
- logging.lockAndFlushAll()
- }
- type loggingT struct {
-
-
-
- toStderr bool
- alsoToStderr bool
-
- stderrThreshold severity
-
- freeList *buffer
-
-
-
- freeListMu sync.Mutex
-
-
- mu sync.Mutex
-
- file [numSeverity]flushSyncWriter
-
- pcs [1]uintptr
-
-
- vmap map[uintptr]Level
-
-
-
- filterLength int32
-
- traceLocation traceLocation
-
-
- vmodule moduleSpec
- verbosity Level
-
- exited bool
- }
- type buffer struct {
- bytes.Buffer
- tmp [64]byte
- next *buffer
- }
- var logging loggingT
- func (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool) {
-
- logging.verbosity.set(0)
-
- atomic.StoreInt32(&logging.filterLength, 0)
-
- if setFilter {
- logging.vmodule.filter = filter
- logging.vmap = make(map[uintptr]Level)
- }
-
-
- atomic.StoreInt32(&logging.filterLength, int32(len(filter)))
- logging.verbosity.set(verbosity)
- }
- func (l *loggingT) getBuffer() *buffer {
- l.freeListMu.Lock()
- b := l.freeList
- if b != nil {
- l.freeList = b.next
- }
- l.freeListMu.Unlock()
- if b == nil {
- b = new(buffer)
- } else {
- b.next = nil
- b.Reset()
- }
- return b
- }
- func (l *loggingT) putBuffer(b *buffer) {
- if b.Len() >= 256 {
-
- return
- }
- l.freeListMu.Lock()
- b.next = l.freeList
- l.freeList = b
- l.freeListMu.Unlock()
- }
- var timeNow = time.Now
- func (l *loggingT) header(s severity, depth int) (*buffer, string, int) {
- _, file, line, ok := runtime.Caller(3 + depth)
- if !ok {
- file = "???"
- line = 1
- } else {
- slash := strings.LastIndex(file, "/")
- if slash >= 0 {
- file = file[slash+1:]
- }
- }
- return l.formatHeader(s, file, line), file, line
- }
- func (l *loggingT) formatHeader(s severity, file string, line int) *buffer {
- now := timeNow()
- if line < 0 {
- line = 0
- }
- if s > fatalLog {
- s = infoLog
- }
- buf := l.getBuffer()
-
-
- _, month, day := now.Date()
- hour, minute, second := now.Clock()
-
- buf.tmp[0] = severityChar[s]
- buf.twoDigits(1, int(month))
- buf.twoDigits(3, day)
- buf.tmp[5] = ' '
- buf.twoDigits(6, hour)
- buf.tmp[8] = ':'
- buf.twoDigits(9, minute)
- buf.tmp[11] = ':'
- buf.twoDigits(12, second)
- buf.tmp[14] = ' '
- buf.nDigits(5, 15, pid, ' ')
- buf.tmp[20] = ' '
- buf.Write(buf.tmp[:21])
- buf.WriteString(file)
- buf.tmp[0] = ':'
- n := buf.someDigits(1, line)
- buf.tmp[n+1] = ']'
- buf.tmp[n+2] = ' '
- buf.Write(buf.tmp[:n+3])
- return buf
- }
- const digits = "0123456789"
- func (buf *buffer) twoDigits(i, d int) {
- buf.tmp[i+1] = digits[d%10]
- d /= 10
- buf.tmp[i] = digits[d%10]
- }
- func (buf *buffer) nDigits(n, i, d int, pad byte) {
- j := n - 1
- for ; j >= 0 && d > 0; j-- {
- buf.tmp[i+j] = digits[d%10]
- d /= 10
- }
- for ; j >= 0; j-- {
- buf.tmp[i+j] = pad
- }
- }
- func (buf *buffer) someDigits(i, d int) int {
-
-
- j := len(buf.tmp)
- for {
- j--
- buf.tmp[j] = digits[d%10]
- d /= 10
- if d == 0 {
- break
- }
- }
- return copy(buf.tmp[i:], buf.tmp[j:])
- }
- func (l *loggingT) println(s severity, args ...interface{}) {
- buf, file, line := l.header(s, 0)
- fmt.Fprintln(buf, args...)
- l.output(s, buf, file, line, false)
- }
- func (l *loggingT) print(s severity, args ...interface{}) {
- l.printDepth(s, 1, args...)
- }
- func (l *loggingT) printDepth(s severity, depth int, args ...interface{}) {
- buf, file, line := l.header(s, depth)
- fmt.Fprint(buf, args...)
- if buf.Bytes()[buf.Len()-1] != '\n' {
- buf.WriteByte('\n')
- }
- l.output(s, buf, file, line, false)
- }
- func (l *loggingT) printf(s severity, format string, args ...interface{}) {
- buf, file, line := l.header(s, 0)
- fmt.Fprintf(buf, format, args...)
- if buf.Bytes()[buf.Len()-1] != '\n' {
- buf.WriteByte('\n')
- }
- l.output(s, buf, file, line, false)
- }
- func (l *loggingT) printWithFileLine(s severity, file string, line int, alsoToStderr bool, args ...interface{}) {
- buf := l.formatHeader(s, file, line)
- fmt.Fprint(buf, args...)
- if buf.Bytes()[buf.Len()-1] != '\n' {
- buf.WriteByte('\n')
- }
- l.output(s, buf, file, line, alsoToStderr)
- }
- func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoToStderr bool) {
- l.mu.Lock()
- if l.traceLocation.isSet() {
- if l.traceLocation.match(file, line) {
- buf.Write(stacks(false))
- }
- }
- data := buf.Bytes()
- if l.toStderr {
- os.Stderr.Write(data)
- } else {
- if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() {
- os.Stderr.Write(data)
- }
- if l.file[s] == nil {
- if err := l.createFiles(s); err != nil {
- os.Stderr.Write(data)
- l.exit(err)
- }
- }
- switch s {
- case fatalLog:
- l.file[fatalLog].Write(data)
- fallthrough
- case errorLog:
- l.file[errorLog].Write(data)
- fallthrough
- case warningLog:
- l.file[warningLog].Write(data)
- fallthrough
- case infoLog:
- l.file[infoLog].Write(data)
- }
- }
- if s == fatalLog {
-
- if atomic.LoadUint32(&fatalNoStacks) > 0 {
- l.mu.Unlock()
- timeoutFlush(10 * time.Second)
- os.Exit(1)
- }
-
-
-
-
- if !l.toStderr {
- os.Stderr.Write(stacks(false))
- }
-
- trace := stacks(true)
- logExitFunc = func(error) {}
- for log := fatalLog; log >= infoLog; log-- {
- if f := l.file[log]; f != nil {
- f.Write(trace)
- }
- }
- l.mu.Unlock()
- timeoutFlush(10 * time.Second)
- os.Exit(255)
- }
- l.putBuffer(buf)
- l.mu.Unlock()
- if stats := severityStats[s]; stats != nil {
- atomic.AddInt64(&stats.lines, 1)
- atomic.AddInt64(&stats.bytes, int64(len(data)))
- }
- }
- func timeoutFlush(timeout time.Duration) {
- done := make(chan bool, 1)
- go func() {
- Flush()
- done <- true
- }()
- select {
- case <-done:
- case <-time.After(timeout):
- fmt.Fprintln(os.Stderr, "glog: Flush took longer than", timeout)
- }
- }
- func stacks(all bool) []byte {
-
- n := 10000
- if all {
- n = 100000
- }
- var trace []byte
- for i := 0; i < 5; i++ {
- trace = make([]byte, n)
- nbytes := runtime.Stack(trace, all)
- if nbytes < len(trace) {
- return trace[:nbytes]
- }
- n *= 2
- }
- return trace
- }
- var logExitFunc func(error)
- func (l *loggingT) exit(err error) {
- fmt.Fprintf(os.Stderr, "glog: exiting because of error: %s\n", err)
-
- if logExitFunc != nil {
- logExitFunc(err)
- return
- }
- l.flushAll()
- l.exited = true
- }
- type syncBuffer struct {
- logger *loggingT
- *bufio.Writer
- file *os.File
- sev severity
- nbytes uint64
- }
- func (sb *syncBuffer) Sync() error {
- return sb.file.Sync()
- }
- func (sb *syncBuffer) Write(p []byte) (n int, err error) {
- if sb.logger.exited {
- return
- }
- if sb.nbytes+uint64(len(p)) >= MaxSize {
- if err := sb.rotateFile(time.Now()); err != nil {
- sb.logger.exit(err)
- }
- }
- n, err = sb.Writer.Write(p)
- sb.nbytes += uint64(n)
- if err != nil {
- sb.logger.exit(err)
- }
- return
- }
- func (sb *syncBuffer) rotateFile(now time.Time) error {
- if sb.file != nil {
- sb.Flush()
- sb.file.Close()
- }
- var err error
- sb.file, _, err = create(severityName[sb.sev], now)
- sb.nbytes = 0
- if err != nil {
- return err
- }
- sb.Writer = bufio.NewWriterSize(sb.file, bufferSize)
-
- var buf bytes.Buffer
- fmt.Fprintf(&buf, "Log file created at: %s\n", now.Format("2006/01/02 15:04:05"))
- fmt.Fprintf(&buf, "Running on machine: %s\n", host)
- fmt.Fprintf(&buf, "Binary: Built with %s %s for %s/%s\n", runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH)
- fmt.Fprintf(&buf, "Log line format: [IWEF]mmdd hh:mm:ss threadid file:line] msg\n")
- n, err := sb.file.Write(buf.Bytes())
- sb.nbytes += uint64(n)
- return err
- }
- const bufferSize = 256 * 1024
- func (l *loggingT) createFiles(sev severity) error {
- now := time.Now()
-
-
- for s := sev; s >= infoLog && l.file[s] == nil; s-- {
- sb := &syncBuffer{
- logger: l,
- sev: s,
- }
- if err := sb.rotateFile(now); err != nil {
- return err
- }
- l.file[s] = sb
- }
- return nil
- }
- const flushInterval = 30 * time.Second
- func (l *loggingT) flushDaemon() {
- for _ = range time.NewTicker(flushInterval).C {
- l.lockAndFlushAll()
- }
- }
- func (l *loggingT) lockAndFlushAll() {
- l.mu.Lock()
- l.flushAll()
- l.mu.Unlock()
- }
- func (l *loggingT) flushAll() {
-
- for s := fatalLog; s >= infoLog; s-- {
- file := l.file[s]
- if file != nil {
- file.Flush()
- file.Sync()
- }
- }
- }
- func CopyStandardLogTo(name string) {
- sev, ok := severityByName(name)
- if !ok {
- panic(fmt.Sprintf("log.CopyStandardLogTo(%q): unrecognized severity name", name))
- }
-
-
- stdLog.SetFlags(stdLog.Lshortfile)
- stdLog.SetOutput(logBridge(sev))
- }
- type logBridge severity
- func (lb logBridge) Write(b []byte) (n int, err error) {
- var (
- file = "???"
- line = 1
- text string
- )
-
- if parts := bytes.SplitN(b, []byte{':'}, 3); len(parts) != 3 || len(parts[0]) < 1 || len(parts[2]) < 1 {
- text = fmt.Sprintf("bad log format: %s", b)
- } else {
- file = string(parts[0])
- text = string(parts[2][1:])
- line, err = strconv.Atoi(string(parts[1]))
- if err != nil {
- text = fmt.Sprintf("bad line number: %s", b)
- line = 1
- }
- }
-
-
- logging.printWithFileLine(severity(lb), file, line, true, text)
- return len(b), nil
- }
- func (l *loggingT) setV(pc uintptr) Level {
- fn := runtime.FuncForPC(pc)
- file, _ := fn.FileLine(pc)
-
- if strings.HasSuffix(file, ".go") {
- file = file[:len(file)-3]
- }
- if slash := strings.LastIndex(file, "/"); slash >= 0 {
- file = file[slash+1:]
- }
- for _, filter := range l.vmodule.filter {
- if filter.match(file) {
- l.vmap[pc] = filter.level
- return filter.level
- }
- }
- l.vmap[pc] = 0
- return 0
- }
- type Verbose bool
- func V(level Level) Verbose {
-
-
-
- if logging.verbosity.get() >= level {
- return Verbose(true)
- }
-
-
- if atomic.LoadInt32(&logging.filterLength) > 0 {
-
-
-
- logging.mu.Lock()
- defer logging.mu.Unlock()
- if runtime.Callers(2, logging.pcs[:]) == 0 {
- return Verbose(false)
- }
- v, ok := logging.vmap[logging.pcs[0]]
- if !ok {
- v = logging.setV(logging.pcs[0])
- }
- return Verbose(v >= level)
- }
- return Verbose(false)
- }
- func (v Verbose) Info(args ...interface{}) {
- if v {
- logging.print(infoLog, args...)
- }
- }
- func (v Verbose) Infoln(args ...interface{}) {
- if v {
- logging.println(infoLog, args...)
- }
- }
- func (v Verbose) Infof(format string, args ...interface{}) {
- if v {
- logging.printf(infoLog, format, args...)
- }
- }
- func Info(args ...interface{}) {
- logging.print(infoLog, args...)
- }
- func InfoDepth(depth int, args ...interface{}) {
- logging.printDepth(infoLog, depth, args...)
- }
- func Infoln(args ...interface{}) {
- logging.println(infoLog, args...)
- }
- func Infof(format string, args ...interface{}) {
- logging.printf(infoLog, format, args...)
- }
- func Warning(args ...interface{}) {
- logging.print(warningLog, args...)
- }
- func WarningDepth(depth int, args ...interface{}) {
- logging.printDepth(warningLog, depth, args...)
- }
- func Warningln(args ...interface{}) {
- logging.println(warningLog, args...)
- }
- func Warningf(format string, args ...interface{}) {
- logging.printf(warningLog, format, args...)
- }
- func Error(args ...interface{}) {
- logging.print(errorLog, args...)
- }
- func ErrorDepth(depth int, args ...interface{}) {
- logging.printDepth(errorLog, depth, args...)
- }
- func Errorln(args ...interface{}) {
- logging.println(errorLog, args...)
- }
- func Errorf(format string, args ...interface{}) {
- logging.printf(errorLog, format, args...)
- }
- func Fatal(args ...interface{}) {
- logging.print(fatalLog, args...)
- }
- func FatalDepth(depth int, args ...interface{}) {
- logging.printDepth(fatalLog, depth, args...)
- }
- func Fatalln(args ...interface{}) {
- logging.println(fatalLog, args...)
- }
- func Fatalf(format string, args ...interface{}) {
- logging.printf(fatalLog, format, args...)
- }
- var fatalNoStacks uint32
- func Exit(args ...interface{}) {
- atomic.StoreUint32(&fatalNoStacks, 1)
- logging.print(fatalLog, args...)
- }
- func ExitDepth(depth int, args ...interface{}) {
- atomic.StoreUint32(&fatalNoStacks, 1)
- logging.printDepth(fatalLog, depth, args...)
- }
- func Exitln(args ...interface{}) {
- atomic.StoreUint32(&fatalNoStacks, 1)
- logging.println(fatalLog, args...)
- }
- func Exitf(format string, args ...interface{}) {
- atomic.StoreUint32(&fatalNoStacks, 1)
- logging.printf(fatalLog, format, args...)
- }
|