GithubHelp home page GithubHelp logo

marcransome / flog Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 1.34 MB

A command-line tool for sending log messages to Apple's unified logging system. 🪵

License: MIT License

C 92.92% CMake 2.02% Just 5.07%
command-line macos unified-logging

flog's Introduction

🔑 gpg   🔑 age   💬 keybase   🌍 web   📧 email


"My imagination requires a judicious rein; I am afraid to let it loose, for it carries me sometimes into appalling places beyond the stars and beneath the world." — Algernon Blackwood.

flog's People

Contributors

dependabot[bot] avatar marcransome avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flog's Issues

Consider building bottles (binary packages)

Adding bottles would simplify the installation process by removing the cmake build-time dependency from the installation process. However, building multiple bottles for different macOS versions as well as x86_64 and arm64e architectures introduces a level of complexity which will need some consideration.

See marcransome/homebrew-tap#1 for an initial set of GitHub Actions workflows catering for x86_64 builds targeting macOS Big Sur (11.x).

Migrate to Meson build system

To simplify the development process, this project should be migrated to the Meson build system in preference to CMake.

Tasks

  • #95
  • Rework unit test configuration
  • Update GitHub workflow(s) and CodeQL configuration
  • Update developer documentation

Option to additionally write to a log file (or to stderr)

Is your feature request related to a problem? Please describe.
It would be nice to be able to write logs to a file too (in addition to writing to the unified log). For everyday macOS users, the unified log is very hard to comb through, so giving them an option to just open a regular log file would be a plus.

Describe the solution you'd like
Add either an -f or an -r option to flog, so we can additionally either write directly to a file, e.g. with

flog -f "$HOME/Library/Logs/uk.co.fidgetbox.log" -l fault -s uk.co.fidgetbox -c general 'unrecoverable failure'

…or tell flog to write to standard error, so we can redirect that to a file, e.g. with

flog -r -l fault -s uk.co.fidgetbox -c general 'unrecoverable failure' 2>> "$HOME/Library/Logs/uk.co.fidgetbox.log"

Describe alternatives you've considered
(none come to mind)

Additional context
The macOS-built-in logger program does not have an option to write to a file directly, but it has an option (-s) to write to stderr, so the user can redirect.

Add `Portfile` to support MacPorts

Tasks to complete:

  • Create basic Portfile definition
  • Add unit tests and update cmake configuration; see #46
  • Add test options test.run, test.cmd and test.target to Portfile accordingly; see portfile(7) for more information
  • Update Portfile checksums to represent the latest release tarball (openssl dgst -rmd160 <file> and openssl dgst -sha256 <file>)

Restructure codebase and add unit tests

Overview

To facilitate unit testing and integrate the cmocka unit testing framework a significant restructure of the existing project code is required. Given that the cmocka framework executes all tests for a given test target within the same process, getopt's reliance on global state is problematic, and it would be better replaced with the libpopt library which provides additional features such as option aliasing. Unit tests for FlogApi and FlogConfig opaque objects and related functions should be added1 after integration of the unit test framework.

Improved error handling should be introduced in place of immediate exit() calls, and use of errno should be replaced with a defined error type.

Intended outcome

To increase unit test coverage, improve error handling, and automate the build and release process.

Tasks

Footnotes

  1. Mocking objects with the cmocka unit test framework may require extra effort given the lack of support for the --wrap option in the macOS linker ld64.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.