1
0
mirror of https://github.com/taigrr/log-socket synced 2026-03-20 16:02:28 -07:00
Commit Graph

51 Commits

Author SHA1 Message Date
90471833d0 feat(slog): add slog.Handler adapter for log-socket
Implements log/slog.Handler that routes structured log records into the
log-socket broadcasting system. Supports namespaces, WithAttrs,
WithGroup, and configurable minimum level.

Also adds Broadcast() as a public entry point for adapter packages
that construct log.Entry values directly.
2026-03-02 03:44:15 +00:00
703f80c5f6 docs: add example programs for common usage patterns
Adds four focused examples in examples/ directory:
- basic: drop-in logger with web UI
- namespaces: namespace-based logging by component
- client: programmatic log client with filtering
- log-levels: all log levels and filtering

Fixes #7
2026-02-20 08:02:17 +00:00
47bfb5ed98 fix: stderr namespace filter, fileInfo depth, panic guard, race safety
- fix(stderr): CreateClient() with no args so stderr sees all namespaces,
  not just 'default'. Previously namespaced logs were invisible on stderr.
- fix(logger): fileInfo depth offset to 2+FileInfoDepth so Logger methods
  report the actual caller, not the log package itself. Default depth (0)
  now correctly shows caller file:line.
- fix(panic): guard args[0] access with len(args) > 0 instead of >= 0.
  Panic/Panicf/Panicln would index out of range when called with no args.
- fix(createLog): nil/initialized check before channel send to prevent
  race with concurrent Destroy calls.
- chore: bump go.mod to 1.25.6
2026-02-17 08:31:21 +00:00
6a709d3963 feat(log): add colored terminal output without external packages (#16)
Adds ANSI color-coded log levels for terminal output:
- TRACE: Gray
- DEBUG: Cyan
- INFO: Green
- NOTICE: Blue
- WARN: Yellow
- ERROR/PANIC/FATAL: Red (bold for PANIC/FATAL)

Colors are auto-detected based on terminal capability and can be
controlled via SetColorEnabled()/ColorEnabled().

Fixes #9
2026-02-17 03:27:53 -05:00
0a78d1ce90 test: add comprehensive benchmark suite (#18)
Adds benchmarks for all log levels (Trace, Debug, Info, Warn, Error),
formatted logging, multiple client fan-out, parallel writes, namespace
filtering, and component-level benchmarks (fileInfo, entry creation).

Uses isolated namespaces to avoid interference with the stderr client.

Fixes #6
2026-02-17 03:25:12 -05:00
93dd230be0 update test version v2.0.1 2025-11-10 16:08:40 -05:00
f86c2dbf46 enable namespaced logging v2.0.0 2025-11-10 16:07:28 -05:00
Daniel Merja
9c571ca955 Update screenshot image in the browser directory 2025-06-29 19:53:24 -07:00
Daniel Merja
45ba154d1e Update Go version to 1.24.4 and overhaul viewer.html with a complete redesign for improved log display and user interaction. (#13) v1.0.6 2025-06-29 02:11:12 -07:00
c89dda8333 error -> warn for broken connection v1.0.5 2025-06-29 00:43:55 -07:00
41aad10e6c add upgrader option v1.0.4 2025-06-29 00:10:09 -07:00
64ab2564c1 upgrade workflow to match go.mod 2025-05-01 18:30:13 -07:00
1c00bc90b8 upgrade deps, readme v1.0.3 2025-05-01 18:27:46 -07:00
f114098a8c uodate go version v1.0.2 2023-08-26 22:00:42 -07:00
Ethan Holz
2571dbe347 Add Github Actions for automated testing (#12)
* ci: Added initial github action for automated testing

* fix: changed go version

* ci: updated to change job name to test
2023-05-13 23:27:20 -07:00
80b80758de Add Default() func v1.0.1 2023-03-29 14:26:06 -07:00
0fa4de7961 Revert "add ability to embed other loggers of varying functionality"
This reverts commit 50c507c8f4.
2023-03-29 14:06:00 -07:00
50c507c8f4 add ability to embed other loggers of varying functionality 2023-03-29 14:02:57 -07:00
e21fb8a614 make pass gofumpt v1.0.0 2022-10-14 22:23:42 -07:00
2492509b6b extract browser from string var, upgrade deps 2022-10-14 22:14:47 -07:00
a1e960366e Merge pull request #11 from ethanholz/log-parity
feat: Updated to include print and added ln variants for all logs
v0.1.13
2022-10-13 08:05:39 -07:00
Ethan Holz
430181e3a2 feat: Updated to include print and added ln variants for all logs 2022-10-13 09:59:04 -05:00
147a8cb30b Merge pull request #10 from ethanholz/README
Added a README
2022-10-10 13:38:59 -07:00
Ethan Holz
8e044e3993 docs: Updated README to include running example. 2022-10-10 12:16:52 -05:00
Ethan Holz
e97d37012e docs: Added inital README 2022-10-10 12:09:29 -05:00
ebef59a9a8 actually set value for depth v0.1.12 2021-08-23 21:58:05 -07:00
b3ceb12277 fixes fileinfo reflection issue v0.1.11 2021-08-23 21:45:08 -07:00
45cad34fdc fixes fileinfo reflection issue 2021-08-23 21:44:56 -07:00
f0c16a0c56 fixes fileinfo reflection issue v0.1.10 2021-08-23 21:36:49 -07:00
c18854598d Added a logger type v0.1.9 2021-08-23 21:25:01 -07:00
63ed3a2ad7 logger => log 2021-08-23 21:12:21 -07:00
f51ec53a89 Adds Notice logging level to support NATS v0.1.8 2021-08-23 20:58:15 -07:00
d21c91379e update go compiler target version 2021-08-17 10:07:07 -07:00
af2116af48 add sponsorship 2021-07-05 21:03:17 -07:00
b65a10e7a8 detect tls presence based on incoming request for websocket v0.1.6 v0.1.7 2021-07-05 16:10:50 -07:00
a07d3a11df minor cleanup, adds support for formatted prints v0.1.5 2021-07-03 08:45:19 -07:00
5f18def7fa Adds license 2021-04-09 11:09:18 -07:00
2c7cf0494e Adds autoscroll feature to browser v0.1.4 2021-04-09 10:39:23 -07:00
b744f083dc general refactoring v0.1.3 2021-04-09 10:05:59 -07:00
1ea76f4ab1 breaks browser out into package 2021-04-09 09:47:49 -07:00
2e01f23b30 Allow setting of stderr level v0.1.1 2021-04-09 09:40:25 -07:00
131f2a4994 adds gitignore v0.1.0 2021-04-09 00:10:28 -07:00
11ce4c4517 Adds example webpage and usage 2021-04-09 00:09:46 -07:00
d6bc080d6b Adds simple websocket based on mux 2021-04-08 21:23:28 -07:00
159e6a4d3a Adds logger directory refactor 2021-04-08 21:20:57 -07:00
537840de8b Adds Flush() to panic and Fatal calls 2021-04-08 20:42:04 -07:00
617b1466ce remove clients from array properly 2021-04-08 19:40:35 -07:00
65ff9008da Adds Flush method 2021-04-08 19:19:24 -07:00
9ff091038a Remove mutexes, allow the GC to take care of things 2021-04-08 17:58:26 -07:00
15a9017e2e Adding tests, structuring data by client 2021-04-08 16:47:14 -07:00