Skip to content

Conversation

@zakame
Copy link
Contributor

@zakame zakame commented Oct 15, 2024

Hi, first off, thanks for this good software!

I was trying out an adaptation of the example and couldn't help but notice the log messages being emitted, cf:

2024/10/16 00:20:42 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) connecting to nsqd
2024/10/16 00:20:42 INF    1 (nsqd.xxx.xxx:4150) connecting to nsqd
[...]
2024/10/16 00:22:33 INF    2 [crazy/go] stopping...
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) received CLOSE_WAIT from nsqd
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) beginning close
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) readLoop exiting
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) breaking out of writeLoop
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) writeLoop exiting
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) finished draining, cleanup exiting
2024/10/16 00:22:33 INF    2 [crazy/go] (nsqd.xxx.xxx:4150) clean close complete
2024/10/16 00:22:33 WRN    2 [crazy/go] there are 0 connections left alive
2024/10/16 00:22:33 INF    2 [crazy/go] stopping handlers
2024/10/16 00:22:33 INF    2 [crazy/go] rdyLoop exiting
2024/10/16 00:22:33 INF    1 (nsqd.xxx.xxx:4150) stopping
2024/10/16 00:22:33 INF    1 (nsqd.xxx.xxx:4150) exiting router
2024/10/16 00:22:33 INF    1 (nsqd.xxx.xxx:4150) beginning close
2024/10/16 00:22:33 INF    1 (nsqd.xxx.xxx:4150) readLoop exiting
2024/10/16 00:22:33 INF    1 (nsqd.xxx.xxx:4150) breaking out of writeLoop
2024/10/16 00:22:33 INF    1 (nsqd.xxx.xxx:4150) writeLoop exiting

I looked around to try toggling them off in the current code, but found that this is actually emitted by the underlying nsq driver, which does not expose a control back to the queue.

This PR adds a WithLogLevel Option that takes nsq.LogLevel consts corresponding to the defined log levels, so one can pass it with nsq.LogLevelError all the way to nsq.LogLevelDebug for increasing levels of verbosity. Not sure if this is the way to do it, so would appreciate guidance 🙇 Thanks!

@appleboy appleboy merged commit 84d913e into golang-queue:main Jan 4, 2025
@appleboy
Copy link
Member

appleboy commented Jan 4, 2025

@zakame Thanks.

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