logger2 0.1.5

A modern, feature-rich replacement for the classic `logger` CLI: syslog (local/remote, RFC3164 & RFC5424), truecolor hex output, emoji, JSON, and a fully configurable TOML config file.
Documentation
BIN        := logger2
CARGO      := cargo
VERSION    := $(shell grep -m1 '^version' Cargo.toml | cut -d '"' -f2)
DIST       := dist

TARGETS := \
	x86_64-unknown-linux-gnu \
	aarch64-unknown-linux-gnu \
	x86_64-apple-darwin \
	aarch64-apple-darwin \
	x86_64-pc-windows-gnu

.PHONY: all build release test check fmt fmt-check lint clean install \
        cross cross-clean dist help $(TARGETS)

all: build

## Build a debug binary
build:
	$(CARGO) build

## Build an optimized release binary for the host target
release:
	$(CARGO) build --release

## Run the full test suite
test:
	$(CARGO) test --all-features

## Run cargo check (fast type/borrow check without codegen)
check:
	$(CARGO) check --all-targets --all-features

## Format all source files
fmt:
	$(CARGO) fmt --all

## Verify formatting without changing files (used in CI)
fmt-check:
	$(CARGO) fmt --all -- --check

## Run clippy with warnings treated as errors
lint:
	$(CARGO) clippy --all-targets --all-features -- -D warnings

## Remove build artifacts
clean:
	$(CARGO) clean
	rm -rf $(DIST)

## Install logger2 to ~/.cargo/bin via `cargo install`
install:
	$(CARGO) install --path . --force

## Cross-compile a release binary for one target: `make cross TARGET=<triple>`
cross:
	rustup target add $(TARGET) 2>/dev/null || true
	$(CARGO) build --release --target $(TARGET)

## Cross-compile release binaries for every supported target
cross-all: $(TARGETS)

$(TARGETS):
	rustup target add $@ 2>/dev/null || true
	$(CARGO) build --release --target $@

## Package release binaries for every target into $(DIST)/
dist: cross-all
	mkdir -p $(DIST)
	@for target in $(TARGETS); do \
		ext=""; \
		case $$target in *windows*) ext=".exe" ;; esac; \
		src="target/$$target/release/$(BIN)$$ext"; \
		if [ -f "$$src" ]; then \
			out="$(DIST)/$(BIN)-$(VERSION)-$$target"; \
			mkdir -p "$$out"; \
			cp "$$src" "$$out/"; \
			cp README.md LICENSE-MIT LICENSE-APACHE "$$out/" 2>/dev/null || true; \
			(cd $(DIST) && tar czf "$(BIN)-$(VERSION)-$$target.tar.gz" "$(BIN)-$(VERSION)-$$target"); \
			echo "packaged $$out"; \
		else \
			echo "skipping $$target (build artifact not found)"; \
		fi; \
	done

## Show this help
help:
	@grep -E '^## ' -A1 Makefile | grep -v '^--' | paste -d ' ' - - | sed 's/^## //'