Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 months 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-17T20:49:52.000Z (over 1 year ago)
- Last Synced: 2024-10-14T03:51:30.414Z (3 months 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.