mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 19:52:25 -06:00
[chore] small logging cleanup (#869)
* handle more syslogging levels, use singular time format variable, add entry .New() function * pass in calldepth to lower log functions to ensure correctly set * update truncate length in syslog test
This commit is contained in:
parent
1d999712e6
commit
9fcfe61410
3 changed files with 75 additions and 61 deletions
|
|
@ -79,7 +79,7 @@ func (suite *SyslogTestSuite) TestSyslogLongMessage() {
|
|||
prefix := fmt.Sprintf(`timestamp="02/01/2006 15:04:05.000" func=%s level=WARN msg="`, funcName)
|
||||
|
||||
entry := <-suite.syslogChannel
|
||||
regex := fmt.Sprintf(`timestamp=.* func=.* level=WARN msg="%s\.\.\.`, longMessage[:1700-len(prefix)-3])
|
||||
regex := fmt.Sprintf(`timestamp=.* func=.* level=WARN msg="%s`, longMessage[:2048-len(prefix)])
|
||||
suite.Regexp(regexp.MustCompile(regex), entry["content"])
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ func (suite *SyslogTestSuite) TestSyslogLongMessageUnixgram() {
|
|||
prefix := fmt.Sprintf(`timestamp="02/01/2006 15:04:05.000" func=%s level=WARN msg="`, funcName)
|
||||
|
||||
entry := <-syslogChannel
|
||||
regex := fmt.Sprintf(`timestamp=.* func=.* level=WARN msg="%s\.\.\.`, longMessage[:1700-len(prefix)-3])
|
||||
regex := fmt.Sprintf(`timestamp=.* func=.* level=WARN msg="%s`, longMessage[:2048-len(prefix)])
|
||||
|
||||
suite.Regexp(regexp.MustCompile(regex), entry["content"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue