* [PATCH 1/8] watchmaildir: ensure I:/W:/E: prefixes in warnings
2020-08-27 12:16 4% [PATCH 0/8] mostly watch-related odds and ends Eric Wong
@ 2020-08-27 12:16 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-08-27 12:16 UTC (permalink / raw)
To: meta
For consistency in output, any URL/path-context-dependent
prefixes should have the same prefix as the actual warning which
triggered it.
---
lib/PublicInbox/WatchMaildir.pm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index 2ba10a9e..768e0efe 100644
--- a/lib/PublicInbox/WatchMaildir.pm
+++ b/lib/PublicInbox/WatchMaildir.pm
@@ -198,7 +198,10 @@ sub _try_path {
return;
}
my $warn_cb = $SIG{__WARN__} || sub { print STDERR @_ };
- local $SIG{__WARN__} = sub { $warn_cb->("path: $path\n", @_) };
+ local $SIG{__WARN__} = sub {
+ my $pfx = ($_[0] // '') =~ /^([A-Z]: )/g ? $1 : '';
+ $warn_cb->($pfx, "path: $path\n", @_);
+ };
if (!ref($inboxes) && $inboxes eq 'watchspam') {
return _remove_spam($self, $path);
}
@@ -443,8 +446,9 @@ sub imap_fetch_all ($$$) {
my ($uids, $batch);
my $warn_cb = $SIG{__WARN__} || sub { print STDERR @_ };
local $SIG{__WARN__} = sub {
+ my $pfx = ($_[0] // '') =~ /^([A-Z]: )/g ? $1 : '';
$batch //= '?';
- $warn_cb->("$url UID:$batch\n", @_);
+ $warn_cb->("$pfx$url UID:$batch\n", @_);
};
my $err;
do {
@@ -875,7 +879,8 @@ sub nntp_fetch_all ($$$) {
my $warn_cb = $SIG{__WARN__} || sub { print STDERR @_ };
my ($err, $art);
local $SIG{__WARN__} = sub {
- $warn_cb->("$url ", $art ? ("ARTICLE $art") : (), "\n", @_);
+ my $pfx = ($_[0] // '') =~ /^([A-Z]: )/g ? $1 : '';
+ $warn_cb->("$pfx$url ", $art ? ("ARTICLE $art") : (), "\n", @_);
};
my $inboxes = $self->{nntp}->{$url};
my $last_art;
^ permalink raw reply related [relevance 7%]
* [PATCH 0/8] mostly watch-related odds and ends
@ 2020-08-27 12:16 4% Eric Wong
2020-08-27 12:16 7% ` [PATCH 1/8] watchmaildir: ensure I:/W:/E: prefixes in warnings Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-08-27 12:16 UTC (permalink / raw)
To: meta
Mostly stuff around -watch, I've finally decided NNTP and IMAP
client support aren't as horrible-to-configure as I was
imagining. Well, maybe, at least I'm finding it somewhat
useful...
One problem I've been trying to avoid is having excessive,
overwhelming amounts of documentation. I tend to get
overwhelmed myself when learning new things, too.
Moving the watch-only stuff out of the config manpage seems like
a step in the right direction in that regard.
Eric Wong (8):
watchmaildir: ensure I:/W:/E: prefixes in warnings
imaptracker: preserve WAL journal_mode if set by user
overidx: inline create_ghost sub
doc: document graceful shutdown signals
doc: speling fickses
watch: imap: only remove \Seen spam
doc: move watch config docs to -watch manpage
doc: watch: expand on NNTP and IMAP-specific knobs
Documentation/public-inbox-config.pod | 38 ++--------
Documentation/public-inbox-edit.pod | 2 +-
Documentation/public-inbox-purge.pod | 2 +-
Documentation/public-inbox-tuning.pod | 2 +-
Documentation/public-inbox-watch.pod | 100 +++++++++++++++++++++++---
lib/PublicInbox/IMAPTracker.pm | 7 +-
lib/PublicInbox/OverIdx.pm | 23 +++---
lib/PublicInbox/WatchMaildir.pm | 31 +++++---
t/over.t | 4 +-
9 files changed, 135 insertions(+), 74 deletions(-)
^ permalink raw reply [relevance 4%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-08-27 12:16 4% [PATCH 0/8] mostly watch-related odds and ends Eric Wong
2020-08-27 12:16 7% ` [PATCH 1/8] watchmaildir: ensure I:/W:/E: prefixes in warnings Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).