https://github.com/6543/logfile-open
wrap the os.OpenFile to respect the USR1 signal
https://github.com/6543/logfile-open
golang golang-library linux logfile
Last synced: about 1 year ago
JSON representation
wrap the os.OpenFile to respect the USR1 signal
- Host: GitHub
- URL: https://github.com/6543/logfile-open
- Owner: 6543
- License: mit
- Created: 2023-08-05T01:41:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-17T20:49:52.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T08:20:40.624Z (over 1 year ago)
- Topics: golang, golang-library, linux, logfile
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logfile-open
wrap the os.OpenFile to respect the USR1 signal
```
go get github.com/6543/logfile-open@latest
```
```go
readWriteCloser, err := logfile.OpenFile("/tmp/some_file.log", 0o660)
```
## Windows
if you compile this on windows it just open the file, as there is no such concept as signals.
if you use the context aware open, the file will still be closed on context close.