Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/reticulum-go: use slog for logging #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

holiman
Copy link

@holiman holiman commented Jan 17, 2025

Hi,

I've recently started looking into reticulum, as find it easier to learn by experimenting in code than reading. While looking/poking at the code, I noticed that this repo uses it's own custom logging semantics.

Nowadays, the slog package is in the golang standard library, much better than the legacy log, capable of level-filtering and configuring various output-options (json/text etc). This PR switches the cmd/reticulum-go cmd to use the slog, but leaves the old logging in the libs. Which becomes a bit odd:

[user@work Reticulum-Go]$ go run ./cmd/reticulum-go/ 
2025/01/17 15:38:39 INFO Initializing Reticulum... "debug level"=-8
2025/01/17 15:38:39 INFO Configuration loaded source=/home/user/.reticulum-go/config
2025/01/17 15:38:39 INFO Directories initialized
2025/01/17 15:38:39 INFO Transport initialized
2025/01/17 15:38:39 INFO Created new identity hash=4165220ebeda2283d89c62306f687efa
2025/01/17 15:38:39 INFO Creating destination...
2025/01/17 15:38:39 [DEBUG-3] Creating new destination: app=Go Client type=0 direction=1
2025/01/17 15:38:39 [DEBUG-5] Calculating hash for destination Go Client.node

I thought I'd check if you're interested in this at all, before I do too much work. If you are, then I can continue and replace it in the remaining code too.

Cheers!

Copy link
Contributor

deepsource-io bot commented Jan 17, 2025

Here's the code health analysis summary for commits 0413d92..54f2418. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@Sudo-Ivan
Copy link
Owner

Yep that is all good with me, thank you for the help.

@holiman
Copy link
Author

holiman commented Jan 31, 2025

I have't fully dropped the ball on this, I just got sidetracked by life a bit.

@holiman
Copy link
Author

holiman commented Feb 21, 2025

Semi-unrelated question. I'd like to set up a minimal flow, for testing and for my own understanding, of a data transfer between two endpoints. It could be over io.Pipe, or over a unix socket.

Do I need to implement a pipe interface first, or is there already some existing way to just transfer data between two endpoints without using the network stack?

@Sudo-Ivan
Copy link
Owner

I am very sorry I have been quite busy. Give me a few days to catch up on some stuff and I will let you know how you can do some testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants