Commit Graph

11 Commits

Author SHA1 Message Date
ridiculousfish
c9b42c6f1f Stop #include-ing wcstringutil.h in flog.h
This is a header dependency that we can break.
2020-07-29 17:04:18 -07:00
Charles Gould
a0faac400d Print warning on failure to match debug category 2020-05-19 21:07:33 +02:00
ridiculousfish
6705a2efc6 Migrate a bunch of code out of common.h
Put it into wcstringutil, path, or a new file null_terminated_array.
2020-01-15 13:16:43 -08:00
ridiculousfish
e3b8203187 Implement logger_t::log_fmt for narrow chars by trampolining to wide chars
This satifies the glibc.
2019-12-08 14:47:52 -08:00
ridiculousfish
a7f1d2c0c7 Add support for fish_trace variable to trace execution
This adds support for `fish_trace`, a new variable intended to serve the
same purpose as `set -x` as in bash. Setting this variable to anything
non-empty causes execution to be traced. In the future we may give more
specific meaning to the value of the variable.

The user's prompt is not traced unless you run it explicitly. Events are
also not traced because it is noisy; however autoloading is.

Fixes #3427
2019-11-02 14:40:57 -07:00
ridiculousfish
82eca4bc86 Run clang-format on all files
The main change here is to reorder headers.
2019-10-13 15:50:48 -07:00
ridiculousfish
b20bdcebfa FLOG narrow-string output to use fwprintf
This avoids mixing narrow and wide I/O on the same stream.
Extends the fix in #5900 by allowing narrow string literals again.
2019-05-31 09:31:42 -07:00
ridiculousfish
ee9e5d4996 Allow disabling debug categories with leading -
This was always supposed to work but the string_prefixes_string call
had the wrong order.
2019-05-29 14:21:50 -07:00
Fabian Homborg
7c1a40fe86 flog: Use wide literals with wide chars
This solves the main part of (careful linebreak)
issue #5900.

I'm betting all the errors that do use narrow IO are broken, including
a bunch of asserts.
2019-05-28 22:39:47 +02:00
ridiculousfish
0150d505de Allow underscores to be treated as dashes in debug categories 2019-05-27 17:38:09 -07:00
ridiculousfish
63a16befd4 Introduce the fish log, a replacement for debug()
This adds a new mechanism for logging, intended to replace debug().

The entry points are FLOG and FLOGF. FLOG can be used to log a sequence of
arguments, FLOGF is for printf-style formatted strings.

Each call to FLOG and FLOGF requires a category. If logging for a category
is not enabled, there is no effect (and arguments are not evaluated).

Categories may be enabled on the command line via the -d option.
2019-05-27 17:24:52 -07:00