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

add option to make log/echo area quiet #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ write the following config with any file name (eg. `.erc.emacs`)
(setq erc-autojoin-channels-alist '(("libera.chat" "#c" "#c++" "#linux"
"#lisp" "##c++" "#clasp" "#clojure" "#guile"
"#vim" "#neovim" "#emacs" "#erc")))
(setq erc-logger-quiet-log t) ;; if you don't want spammed with "Added to..." messages
(erc-logger-log-start))))
</pre>

Expand Down
10 changes: 8 additions & 2 deletions erc-logger.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@
:type 'string
:group 'erc-logger)


(defcustom erc-logger-log-interval
10
"The interval (second) to run `erc-log-buffers' repeatedly."
:type 'float
:group 'erc-logger)

(defcustom erc-logger-quiet-log nil
"Silence echo area and `*Messages*' notifications about appending files."
:type 'boolean
:group 'erc-logger)

(defvar erc-logger-log-timer nil)
(defvar erc-logger-log-date nil)
(defvar erc-logger-log-todays-date nil)
Expand Down Expand Up @@ -126,7 +130,9 @@
(setq current-message-point new-current-message-point)))
(if (file-exists-p file-full-path)
(when (not (= end-of-message-point current-message-point))
(append-to-file current-message-point end-of-message-point file-full-path))
(let ((inhibit-message (if erc-logger-quiet-log t inhibit-message))
(message-log-max (if erc-logger-quiet-log nil message-log-max)))
(append-to-file current-message-point end-of-message-point file-full-path)))
(erc-logger-write-file-immut file-full-path))
(when (not (= end-of-message-point current-message-point))
(puthash erc-buffer end-of-message-point erc-logger-irc-buffer-size-map)))
Expand Down