Added log func

pull/26/head
E. Almqvist 4 years ago
parent cd7f39e221
commit c1aef916a0
  1. 2
      src/Makefile
  2. 3
      src/config.h
  3. 1
      src/dwm.c
  4. 13
      src/log.c
  5. 2
      src/log.h

@ -3,7 +3,7 @@
include config.mk
SRC = drw.c dwm.c util.c
SRC = drw.c dwm.c util.c log.c
OBJ = ${SRC:.c=.o}
all: options dwm dwm-msg

@ -1,5 +1,8 @@
/* See LICENSE file for copyright and license details. */
/* logging */
static const char* logfile = "/tmp/dwm.log";
/* appearance */
static const unsigned int borderpx = 4; /* border pixel of windows */
static const unsigned int snap = 16; /* snap pixel (32)*/

@ -44,6 +44,7 @@
#include "drw.h"
#include "util.h"
#include "log.h"
/* macros */
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)

@ -1,3 +1,16 @@
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdarg.h>
#include "config.h"
#include "log.h"
void flog(char* fstr, ...) {
FILE* fp;
fp = fopen(logfile, "a");
fprintf(fp, fstr, ...);
fclose(fp);
}

@ -1,3 +1,3 @@
/* See LICENSE file for copyright and license details. */
static void log();
static void flog(char* fstr, ...);

Loading…
Cancel
Save