File: erc-log.el.html

This file implements log file writing support for ERC.

Quick start:

(require 'erc-log)
(setq erc-log-channels-directory "/path/to/logfiles") ; must be writable
(erc-log-enable)

Or:

M-x customize-variable erc-modules, and add "log".

There are two ways to setup logging. The first (default) method will save buffers on /part, /quit, or killing the channel buffer.

The second will write to the log files on each incoming or outgoing line - this may not be optimal on a laptop HDD. To use this method, add the following to the above instructions.

(setq erc-save-buffer-on-part nil
      erc-save-queries-on-quit nil
      erc-log-write-after-send t
      erc-log-write-after-insert t)

If you only want to save logs for some buffers, customize the variable erc-enable-logging.

How it works:

If logging is enabled, at some point, erc-save-buffer-in-logs will be called. The "end" of the buffer is taken from erc-insert-marker, while erc-last-saved-position holds the position the buffer was last saved at (as a marker, or if the buffer hasn't been saved before, as the number 1 (point-min)).

The region between erc-last-saved-position and erc-insert-marker is saved to the current buffer's logfile, and erc-last-saved-position is updated to reflect this.

Defined variables (13)

erc-enable-loggingIf non-nil, ERC will log IRC conversations.
erc-generate-log-file-name-functionA function to generate a log filename.
erc-log-channels-directoryThe directory to place log files for channels.
erc-log-file-coding-systemThe coding system ERC should use for writing log files.
erc-log-filter-functionIf non-nil, pass text to this function before writing it to a log file.
erc-log-insert-log-on-openInsert log file contents into the buffer if a log file exists.
erc-log-modeNon-nil if Erc-Log mode is enabled.
erc-log-mode-hookHook run after entering or leaving ‘erc-log-mode’.
erc-log-write-after-insertIf non-nil, write to log file when new text is added to a logged ERC buffer.
erc-log-write-after-sendIf non-nil, write to log file after every message you send.
erc-save-buffer-on-partSave the channel buffer content using ‘erc-save-buffer-in-logs’ on PART.
erc-save-queries-on-quitSave all query (also channel) buffers of the server on QUIT.
erc-truncate-buffer-on-saveErase the contents of any ERC (channel, query, server) buffer when it is saved.

Defined functions (19)

erc-conditional-save-buffer(BUFFER)
erc-conditional-save-queries(PROCESS)
erc-current-logfile(&optional BUFFER)
erc-generate-log-file-name-long(BUFFER TARGET NICK SERVER PORT)
erc-generate-log-file-name-network(BUFFER TARGET NICK SERVER PORT)
erc-generate-log-file-name-short(BUFFER &rest IGNORE)
erc-generate-log-file-name-with-date(BUFFER &rest IGNORE)
erc-log--check-legacy-implicit-enabling-by-truncate()
erc-log--save-on-clear(_ END)
erc-log-all-but-server-buffers(BUFFER)
erc-log-disable()
erc-log-disable-logging(BUFFER)
erc-log-enable()
erc-log-mode(&optional ARG)
erc-log-setup-logging(BUFFER)
erc-log-standardize-name(FILENAME)
erc-logging-enabled(&optional BUFFER)
erc-save-buffer-in-logs(&optional BUFFER)
erc-save-query-buffers(PROCESS)

Defined faces (0)