log4go | Logging package similar to log4j for the Go programming

 by   AlexStocks Go Version: v1.0.7 License: BSD-2-Clause

kandi X-RAY | log4go Summary

kandi X-RAY | log4go Summary

log4go is a Go library typically used in Logging, Prometheus applications. log4go has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Please see for more log4go usages. My personal package (github.com/AlexStocks/goext/log) wrappered log4go functions further more which provides the most powerful log4go.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              log4go has a low active ecosystem.
              It has 10 star(s) with 6 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of log4go is v1.0.7

            kandi-Quality Quality

              log4go has 0 bugs and 0 code smells.

            kandi-Security Security

              log4go has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              log4go code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              log4go is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              log4go releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed log4go and discovered the below as its top functions. This is intended to give you an instant insight into log4go implemented functionality, and help decide if they suit your requirements.
            • Create a new FileLogWriter
            • Format log record
            • confToFileLogWriter creates a new FileLogWriter
            • confToXMLLogWriter creates a FileLogWriter
            • Create a socket log writer
            • loadConfFile loads the configuration from a file
            • Test if json is valid
            • Easyjson15d5decodeg encodes a LogRecord into out .
            • Convert to socket log writer
            • Easyjson15d5d517DecodegDecodeg decodes into out .
            Get all kandi verified functions for this library.

            log4go Key Features

            No Key Features are available at this moment for log4go.

            log4go Examples and Code Snippets

            No Code Snippets are available at this moment for log4go.

            Community Discussions

            QUESTION

            Why these method with same function written differently?
            Asked 2018-Jan-09 at 08:28
            func (log Logger) Warn(arg0 interface{}, args ...interface{}) error {
            const (
                lvl = WARNING
            )
            var msg string
            switch first := arg0.(type) {
            case string:
                // Use the string as a format string
                msg = fmt.Sprintf(first, args...)
            case func() string:
                // Log the closure (no other arguments used)
                msg = first()
            default:
                // Build a format string so that it will be similar to Sprint
                msg = fmt.Sprintf(fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...)
            }
            log.intLogf(lvl, msg)
            return errors.New(msg)
            }
            
            func (log Logger) Info(arg0 interface{}, args ...interface{}) {
            const (
                lvl = INFO
            )
            switch first := arg0.(type) {
            case string:
                // Use the string as a format string
                log.intLogf(lvl, first, args...)
            case func() string:
                // Log the closure (no other arguments used)
                log.intLogc(lvl, first)
            default:
                // Build a format string so that it will be similar to Sprint
                log.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...)
            }
            
            ...

            ANSWER

            Answered 2018-Jan-09 at 03:41

            The most likely explanation is that due to the fact that Logger.Warn method returns an error value, it was refactored to at first save the value it needs to log into variable msg and then log it separately as well as return it as the error. Logger.Info, at the same time, logs the message as soon as it is possible because it is not required to return the message. This seems to be the only difference in the way these functions work.

            Source https://stackoverflow.com/questions/48161011

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install log4go

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/AlexStocks/log4go.git

          • CLI

            gh repo clone AlexStocks/log4go

          • sshUrl

            git@github.com:AlexStocks/log4go.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link