Julius Plenz
70ec3867fe
clean up zero-byte logfile on immediate exit
...
Otherwise, a zero-byte log file stays behind after every call to `i3
--get-socketpath`. Also, replace "return" calls with more explicit "exit"
calls.
Before:
$ ls -ld /tmp/i3* | wc -l; \
repeat 10 i3 --get-socketpath >/dev/null; \
ls -ld /tmp/i3* | wc -l
1
11
Now:
$ ls -ld /tmp/i3* | wc -l; \
repeat 10 i3 --get-socketpath >/dev/null; \
ls -ld /tmp/i3* | wc -l
1
1
Signed-off-by: Julius Plenz <julius@plenz.com>
2012-08-11 02:23:03 +02:00
Michael Stapelberg
0e752070ac
explicitly set filenames to $(basename __FILE__)
...
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +02:00
Quentin Glidic
bdc078914b
i3: Replace loglevels by a global debug logging
...
File-limited were not used nor really useful
Besides, they are painful to maintain in Makefile rules compared to the
benefit
2012-07-22 18:41:12 +02:00
Michael Stapelberg
280a35717b
log.c: len is always positive, remove useless check (Thanks Marcus)
2012-05-02 20:07:59 +02:00
Michael Stapelberg
eedd1a64d7
Make log.c figure out the physical amount of memory on Mac OS X (Thanks Marcus)
2012-05-02 20:05:07 +02:00
Michael Stapelberg
206b96202c
Use (void) instead of () for functions without args (Thanks fernandotcl)
...
See also:
http://article.gmane.org/gmane.linux.kernel/1268792
The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4
.
2012-03-31 10:53:04 +02:00
Michael Stapelberg
dee7c07ad2
shmlog: store meta information in the buffer itself, store path as X11 atom
...
This makes i3-dump-log completely independent of a running i3 instance.
2012-01-06 23:40:07 +00:00
Michael Stapelberg
68544a519e
Handle vsnprintf overflows (Thanks Han)
2011-12-30 01:26:36 +01:00
Michael Stapelberg
f7a73f4a68
fix the SHM log size
2011-12-10 11:15:57 +00:00
Michael Stapelberg
e65ee63763
Implement logging to a SHM ringbuffer
...
This feature is automatically enabled when running a debug version of i3.
The logfile will use 1% of your physical RAM size, but at max 25 MiB.
2011-12-10 10:50:33 +00:00
Michael Stapelberg
42d355f2b7
normalize modelines/headers across src/*.c
2011-10-22 23:40:02 +01:00
Michael Stapelberg
f09d9a4c37
log: use localtime_r instead of localtime
...
localtime_r does not have the side-effect of behaving like it called tzset(),
in particular it will save one stat(/etc/localtime) syscall. This is not a big
deal, but it makes the strace output cleaner and thus more useful :).
2011-10-18 18:32:47 +01:00
Michael Walle
8adcf3e5d1
set close-on-exec flag on errorlogfile
...
Make sure the file descriptor is closed within the child after forking.
Signed-off-by: Michael Walle <michael@walle.cc>
2011-10-01 17:44:22 +01:00
Michael Stapelberg
22882f4e89
Bugfix: Initialize verbose to 'false' (Thanks tilman)
...
Verbosity was set to 'true' when we started the tree branch.
We forgot to set it back to 'false' :-).
2011-08-17 12:16:32 +02:00
Michael Stapelberg
48f5166daf
log: display time in microseconds when DEBUG_TIMING is set
2011-07-10 23:11:21 +02:00
Michael Stapelberg
c55abca115
add i3-nagbar. tells you about config file errors (for example)
2011-07-10 14:33:19 +02:00
Michael Stapelberg
5625a2f17f
log.c: fix indenting
2010-11-29 22:28:23 +01:00
Michael Stapelberg
7f3a77ac6a
loglevel bitmasks needs to be larger because we got more than 32 files
2010-04-17 17:46:11 +02:00
Michael Stapelberg
c145f7e529
first step of the big refactoring ("tree" branch).
...
From here on, we can track changes. It made no sense to put the
development up to this point into git.
2010-04-13 13:17:39 +02:00
Michael Stapelberg
4226cc61de
add log.c/log.h which contain all the log related macros and functions
2009-12-19 22:40:23 +01:00