emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Meng Weng Wong <mengwong@gmail.com>
To: emacs-orgmode@gnu.org
Subject: org-mode as a logging target in three easy steps
Date: Sat, 20 Jun 2020 17:52:00 +0800	[thread overview]
Message-ID: <CA+r+iygnFjKv0+jy4poZXmLrbQ51TTmshNN_j8Yc=VsjBLjiTA@mail.gmail.com> (raw)

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

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 --]

                 reply	other threads:[~2020-06-20  9:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

  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+iygnFjKv0+jy4poZXmLrbQ51TTmshNN_j8Yc=VsjBLjiTA@mail.gmail.com' \
    --to=mengwong@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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