123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package logger
- import (
- "net/http"
- "strings"
- )
- var RollBarEnabled = false
- type RollBarStatusCodes []int
- var RollBarSkipStatusCodes = RollBarStatusCodes{
- http.StatusContinue,
- http.StatusSwitchingProtocols,
- http.StatusProcessing,
- http.StatusEarlyHints,
- http.StatusOK,
- http.StatusCreated,
- http.StatusAccepted,
- http.StatusNonAuthoritativeInfo,
- http.StatusNoContent,
- http.StatusResetContent,
- http.StatusPartialContent,
- http.StatusMultiStatus,
- http.StatusAlreadyReported,
- http.StatusIMUsed,
- http.StatusMultipleChoices,
- http.StatusMovedPermanently,
- http.StatusFound,
- http.StatusSeeOther,
- http.StatusNotModified,
- http.StatusUseProxy,
- http.StatusTemporaryRedirect,
- http.StatusPermanentRedirect,
- http.StatusForbidden,
- http.StatusNotFound,
- http.StatusMethodNotAllowed,
- }
- func (r RollBarStatusCodes) contain(status int) bool {
- for _, v := range r {
- if v == status {
- return true
- }
- }
- return false
- }
- type RollBarErrors []string
- var RollBarSkipErrors = RollBarErrors{}
- func (r RollBarErrors) contain(str string) bool {
- for _, v := range r {
- if v == str || strings.Contains(str, v) {
- return true
- }
- }
- return false
- }
|