Skip to content

Feature/log timestamp - #90

Closed
ZsBT wants to merge 3 commits into
rofl0r:masterfrom
ZsBT:feature/log-timestamp
Closed

Feature/log timestamp#90
ZsBT wants to merge 3 commits into
rofl0r:masterfrom
ZsBT:feature/log-timestamp

Conversation

@ZsBT

@ZsBT ZsBT commented Sep 4, 2025

Copy link
Copy Markdown

Adding timestamp to stderr log, using dprintf, keeping the fmt option.
Also a startup message tells the bind address.

@ZsBT

ZsBT commented Aug 28, 2026

Copy link
Copy Markdown
Author

Kept an eye on the review of a similar PR #70

Comment thread sockssrv.c
locking when called from different threads. for the same reason we use dprintf,
which writes directly to an fd. */
#define dolog(...) do { if(!quiet) dprintf(2, __VA_ARGS__); } while(0)
static inline void dolog(const char *fmt, ...) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your code ignores the quiet flag. also inline inserts the code at every callsite, bloating the binary. since logging is not performance sensitive, this should only be static. also localtime_r isn't available on all platforms afaik (even though it's in my POSIX 2008 manpages).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the findings. I'll close this PR to open a new one.

@ZsBT

ZsBT commented Sep 3, 2026

Copy link
Copy Markdown
Author

closing as incompatible.

@ZsBT ZsBT closed this Sep 3, 2026
@ZsBT ZsBT mentioned this pull request Sep 3, 2026
@ZsBT
ZsBT deleted the feature/log-timestamp branch September 3, 2026 20:36
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