summaryrefslogtreecommitdiff
path: root/internal/log/writer.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2022-11-20 16:40:15 +0000
committerLibravatar GitHub <noreply@github.com>2022-11-20 17:40:15 +0100
commit4a9538593c6110b5972d802aebf1c4990edafe38 (patch)
treed4b5214dac6726ccc561a6497f2593e415a0ff7d /internal/log/writer.go
parent[chore] improve errors returned fetching account/statues from DB (#1084) (diff)
downloadgotosocial-4a9538593c6110b5972d802aebf1c4990edafe38.tar.xz
[chore] simplify logging to remove "safetywriter" given os.File has concurrency protection (#1083)
Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/log/writer.go')
-rw-r--r--internal/log/writer.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/internal/log/writer.go b/internal/log/writer.go
deleted file mode 100644
index 4356d9b7d..000000000
--- a/internal/log/writer.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- GoToSocial
- Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package log
-
-import (
- "io"
- "sync"
-)
-
-// safewriter wraps a writer to provide mutex safety on write.
-type safewriter struct {
- w io.Writer
- m sync.Mutex
-}
-
-func (w *safewriter) Write(b []byte) (int, error) {
- w.m.Lock()
- n, err := w.w.Write(b)
- w.m.Unlock()
- return n, err
-}