[wiki] [sites] Revert "Added logging patch" || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Fri, 18 Aug 2023 18:20:09 +0200

commit f4a78f5c35979690b88961989f500f4213fb3d5a
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri Aug 18 18:24:54 2023 +0200

    Revert "Added logging patch"
    
    This reverts commit f5618f1c4ad679952c078b4b8e4b7a15e19e41a1.
    
    Reasons:
    - The link to the patch doesn't work.
    - Whats even the point of a trivial patch.
    - The patch is buggy (possible NULL dereference, etc).

diff --git a/dwm.suckless.org/patches/logging/dwm-logging-6.4-20230814-17c7c0a.diff b/dwm.suckless.org/patches/logging/dwm-logging-6.4-20230814-17c7c0a.diff
deleted file mode 100644
index 700b691d..00000000
--- a/dwm.suckless.org/patches/logging/dwm-logging-6.4-20230814-17c7c0a.diff
+++ /dev/null
_AT_@ -1,80 +0,0 @@
-From 17c7c0ae9713c782eb032a4be67a42311269059a Mon Sep 17 00:00:00 2001
-From: fami fish <19bors.steriann_AT_gmail.com>
-Date: Mon, 14 Aug 2023 22:23:51 +0300
-Subject: [PATCH] dwm-logging-6.4
-
----
- config.def.h |  3 +++
- dwm.c        | 22 ++++++++++++++++++++++
- 2 files changed, 25 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index 9efa774..f86ab67 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -1,5 +1,8 @@
- /* See LICENSE file for copyright and license details. */
- 
-+/* logging & debugging */
-+static const unsigned int logfile        = 1;   /* 1 means enable logging to a file*/    
-+
- /* appearance */
- static const unsigned int borderpx  = 1;        /* border pixel of windows */
- static const unsigned int snap      = 32;       /* snap pixel */
-diff --git a/dwm.c b/dwm.c
-index f1d86b2..d0f6db7 100644
---- a/dwm.c
-+++ b/dwm.c
-_AT_@ -25,6 +25,7 @@
- #include <signal.h>
- #include <stdarg.h>
- #include <stdio.h>
-+#include <time.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
-_AT_@ -222,6 +223,7 @@ static void updateclientlist(void);
- static int updategeom(void);
- static void updatenumlockmask(void);
- static void updatesizehints(Client *c);
-+static void logstr(char *c);
- static void updatestatus(void);
- static void updatetitle(Client *c);
- static void updatewindowtype(Client *c);
-_AT_@ -2001,6 +2003,24 @@ updatesizehints(Client *c)
- 	c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
- 	c->hintsvalid = 1;
- }
-+void 
-+logstr(char* c) {
-+    FILE *f;
-+    time_t now;
-+    struct tm tm;
-+
-+    f = fopen("dwm.log", "a+");
-+    setbuf(f, NULL); /* disables buffering */
-+    if (f == NULL) { 
-+        return;
-+    }
-+    
-+    now = time(NULL);
-+    tm = *localtime(&now);
-+
-+    fprintf(f, "[%02d:%02d:%02d] %s", tm.tm_hour, tm.tm_min, tm.tm_sec, c);
-+    return;
-+}
- 
- void
- updatestatus(void)
-_AT_@ -2143,6 +2163,8 @@ zoom(const Arg *arg)
- int
- main(int argc, char *argv[])
- {
-+    logstr("DWM started");
-+
- 	if (argc == 2 && !strcmp("-v", argv[1]))
- 		die("dwm-"VERSION);
- 	else if (argc != 1)
--- 
-2.41.0
-
diff --git a/dwm.suckless.org/patches/logging/index.md b/dwm.suckless.org/patches/logging/index.md
deleted file mode 100644
index 0259cbe1..00000000
--- a/dwm.suckless.org/patches/logging/index.md
+++ /dev/null
_AT_@ -1,16 +0,0 @@
-logging
-=======
-
-Description
------------
-This patch implements a very basic file logging utility. It is designed for those
-working on DWM source code.
-
-
-Download
---------
-* [dwm-logging-20230814-17c7c0a.diff](logging.diff)
-
-Authors
--------
-* Fami fish - <19bors.steriann_AT_gmail.com>
Received on Fri Aug 18 2023 - 18:20:09 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 18 2023 - 18:25:09 CEST