emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode as a logging target in three easy steps
@ 2020-06-20  9:52 Meng Weng Wong
  0 siblings, 0 replies; only message in thread
From: Meng Weng Wong @ 2020-06-20  9:52 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

I've been enjoying a featherweight alternative to log levels, made possible
by org-mode. I've done this a couple of times now and am feeling good
enough about it to recommend it to others.

The next time you write a little throwaway 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: Enjoy!

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 :)

You can tail the logfile with M-x auto-revert-mode.

That is all!

[-- Attachment #2: Type: text/html, Size: 1235 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-20  9:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-20  9:52 org-mode as a logging target in three easy steps Meng Weng Wong

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).