From: Meng Weng Wong <mengwong@gmail.com>
To: emacs-orgmode@gnu.org
Subject: org-mode as a logging target
Date: Sat, 20 Jun 2020 15:37:13 +0800 [thread overview]
Message-ID: <CA+r+iyjw9wN7JycJ8SSZutpfksip_7sCdrcQ50Eb6LDTUAJXqw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
I've been enjoying a featherweight alternative to log levels, made possible
by org-mode.
Try this the next time you write a little throwaway command-line utility
script:
Step 1: Add asterisks to the front of your printf traces.
Step 2: Tee your STDOUT / STDERR to a file named log.org
Step 3: Open the log file in org-mode.
Step 4: Rejoice!
Optional: You can tail the logfile with M-x auto-revert-mode.
This illustration uses a Github scraper as an example:
https://github.com/mengwong/git-scrape
https://twitter.com/mengwong/status/1274236595109982208
This is no substitute for real structured logging, of course :)
That is all.
[-- Attachment #2: Type: text/html, Size: 1123 bytes --]
next reply other threads:[~2020-06-21 15:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 7:37 Meng Weng Wong [this message]
2020-06-21 19:09 ` org-mode as a logging target Diego Zamboni
2020-06-21 19:25 ` Russell Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+r+iyjw9wN7JycJ8SSZutpfksip_7sCdrcQ50Eb6LDTUAJXqw@mail.gmail.com \
--to=mengwong@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.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).