mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
dashboard, log: gosimple
This commit is contained in:
parent
64af3ef1e2
commit
0f93200c00
2 changed files with 3 additions and 3 deletions
|
|
@ -62,7 +62,7 @@ func (db *Dashboard) handleLogRequest(r *LogsRequest, c *client) {
|
|||
log.Warn("Failed to open logdir", "path", db.logdir, "err", err)
|
||||
return
|
||||
}
|
||||
re := regexp.MustCompile("\\.log$")
|
||||
re := regexp.MustCompile(`\.log$`)
|
||||
fileNames := make([]string, 0, len(files))
|
||||
for _, f := range files {
|
||||
if f.Mode().IsRegular() && re.MatchString(f.Name()) {
|
||||
|
|
@ -155,7 +155,7 @@ func (db *Dashboard) streamLogs() {
|
|||
)
|
||||
|
||||
// The log records are always written into the last file in alphabetical order, because of the timestamp.
|
||||
re := regexp.MustCompile("\\.log$")
|
||||
re := regexp.MustCompile(`\.log$`)
|
||||
i := len(files) - 1
|
||||
for i >= 0 && (!files[i].Mode().IsRegular() || !re.MatchString(files[i].Name())) {
|
||||
i--
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ func RotatingFileHandler(path string, limit uint, formatter Format) (Handler, er
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
re := regexp.MustCompile("\\.log$")
|
||||
re := regexp.MustCompile(`\.log$`)
|
||||
last := len(files) - 1
|
||||
for last >= 0 && (!files[last].Mode().IsRegular() || !re.MatchString(files[last].Name())) {
|
||||
last--
|
||||
|
|
|
|||
Loading…
Reference in a new issue