https://github.com/aletheia7/ul
Provides macOS Sierra/OSX Unified Loggging functionality via cgo
https://github.com/aletheia7/ul
golang logging macos osx sierra unified xcode
Last synced: 5 months ago
JSON representation
Provides macOS Sierra/OSX Unified Loggging functionality via cgo
- Host: GitHub
- URL: https://github.com/aletheia7/ul
- Owner: aletheia7
- License: bsd-2-clause
- Created: 2017-09-08T00:03:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T13:07:11.000Z (almost 3 years ago)
- Last Synced: 2023-08-11T22:32:19.721Z (over 2 years ago)
- Topics: golang, logging, macos, osx, sierra, unified, xcode
- Language: Go
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/aletheia7/ul)
#### Install
```bash
go get github.com/aletheia7/ul
go test -v
```
- Requires OSX Xcode compiler
- Supports macOS os_log subsystem/category logging
- Implements io.Writer and can be used with the go log package
#### Example
```go
package main
import (
"github.com/aletheia7/ul"
"log"
)
func main() {
l := ul.New()
l.Log("Hello")
// To see subsystem/category messages:
// # log stream --level debug --predicate 'subsystem == "com.example.myapp"'
// Filtering the log data using "subsystem == "com.example.myapp""
// Timestamp Thread Type Activity PID
// 2017-09-07 17:17:01.680996-0700 0x20870 Default 0x0 1842 t: [com.example.myapp.whatever] hi
lo := ul.New_object("com.example.myapp", "whatever")
// Must call Release() for subsystem/category logger only
defer lo.Release()
lo.Log("hi")
// golang log package
mylogger := log.New(lo, "stuff ", log.Lshortfile|log.Ltime)
mylogger.Println("wow")
}
```
#### License
Use of this source code is governed by a BSD-2-Clause license that can be found
in the LICENSE file.
[](https://opensource.org/)