From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 3tgTEWbc7V6SegAA0tVLHw (envelope-from ) for ; Sat, 20 Jun 2020 09:52:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eCR/DGbc7V6NUAAA1q6Kng (envelope-from ) for ; Sat, 20 Jun 2020 09:52:38 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9F49C94038E for ; Sat, 20 Jun 2020 09:52:37 +0000 (UTC) Received: from localhost ([::1]:50114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmaAu-0004vW-3e for larch@yhetil.org; Sat, 20 Jun 2020 05:52:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmaAZ-0004vC-6t for emacs-orgmode@gnu.org; Sat, 20 Jun 2020 05:52:15 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:33543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmaAX-0003c7-0f for emacs-orgmode@gnu.org; Sat, 20 Jun 2020 05:52:14 -0400 Received: by mail-io1-xd2e.google.com with SMTP id i25so14199247iog.0 for ; Sat, 20 Jun 2020 02:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=o3nL4b0kRPis+RDa6SdIT5U+TK6DD930uCg7szgqFrs=; b=YWuIUV6tdCjyqPwFBGIWVu+un0BY2YufjzNYdyMkjs5b/5By6QvXsr8bKaLqpgu2jK N2iwuj43ZuNgdVql5W6CH9HCc8508QTeMkcRHK/4BScViHVtOI/JZFeKSsZO6RAXVNIg c3f7W3yjvemK6MURAox3+g+iNbOIj8yed3cgi4R3uAYxgVfQ/ySHojR0TJIxJXnE20e8 O8wJ3Zsv0mUfUqKMieopb598NA5V7ojFFvE0lcZBsW4wuZMc/IbDcSb73lreBBFxUYXo djNdlTQPDwUL3caAeRjUtJWSLPkWrG/5NmksrCA1pJeCZQPRehEuEWe86sA1ivUrO4UE ahUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=o3nL4b0kRPis+RDa6SdIT5U+TK6DD930uCg7szgqFrs=; b=WLd7hqZVt9LgdCBhNUG/Ojmk0LLUV7R/8C6STTmE6KwCUVYsJTkyH1eS1ACFZFPqA3 xV0O3iCAZKjjr5DVCUFTeM7rajb6CG4KPQ8EWWV73on58GPJkg7EjI/jYln9dOrEbyEU CqBcotfw9XmbadTFJPpWtHxqYT12Y3z4sdLvYotf52xID2YCbdMoy+xzvxMAC3P9lDlC M6g8y83uAMJvfZLme8KNyItmXLSaIrbC6Ak3P/xqx7qyvzeNuXZHHfB77ufIkwU7TTuW wNgmaOUP14Tdkk0yL1MWckLF+D3liG/PKtjXgg+alP4ekmGcILYOxRM+K5kOhCO4I54o dzjQ== X-Gm-Message-State: AOAM5300zODjQboY/mBjNzzSIJHw0vQ/Q6zFyVWBSTun1GIUNwKGh4GO HlEV5gj+5gaT78CE9HnOSuXpDPFqUQYyzNIxvBdJR3nD X-Google-Smtp-Source: ABdhPJyKac5A36zppi9bf9Avn57ck+cZaKeTRsqjww41sFVQWd7JmHxS/mmsb1gBWNKAQTQcOtBCMgQVCpMRBAzLQgE= X-Received: by 2002:a05:6602:2004:: with SMTP id y4mr8678150iod.130.1592646731521; Sat, 20 Jun 2020 02:52:11 -0700 (PDT) MIME-Version: 1.0 From: Meng Weng Wong Date: Sat, 20 Jun 2020 17:52:00 +0800 Message-ID: Subject: org-mode as a logging target in three easy steps To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000af60fd05a880f641" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2e; envelope-from=mengwong@gmail.com; helo=mail-io1-xd2e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YWuIUV6t; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.71 X-TUID: LELKiieOM24m --000000000000af60fd05a880f641 Content-Type: text/plain; charset="UTF-8" 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! --000000000000af60fd05a880f641 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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=C2=A0to the front of your printf traces.

Step 2: Tee your STDOUT / STDERR to a file named=C2= =A0log.org
=
Step 3: Open the log file in org-mode.

<= div>Step 4: Enjoy!

This illustration uses a Github= scraper as an example:
https://github.com/mengwong/git-scrape

This is no substi= tute for real structured logging, of course :)

You= =C2=A0can=C2=A0tail the logfile with M-x auto-revert-mode.

That is all!

--000000000000af60fd05a880f641--