Commit Graph

36 Commits

Author SHA1 Message Date
Max Kellermann
c843bce9f5 LogLevel: rename DEFAULT to NOTICE
"DEFAULT" is a bad name - all it says is that it's the default value,
but it doesn't say what it means.  The name NOTICE mimics the syslog
level.
2020-09-23 14:22:33 +02:00
Rosen Penev
c846ee0d1b
replace stdarg.h with cstdarg
The former was deprecated in C++14. The Standard says they are the same:

The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.

Also changed va_list to the std:: namespace version, which is the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev
edc4989d9c
change errno.h to cerrno
The former is deprecated by C++14. It's also functionally the same.

From the standard:

19.4
The header<cerrno>is described in Table 43. Its contents are the same as
the POSIX header<errno.h>,except that errno shall be defined as a macro.
[Note: The intent is to remain in close alignment with the POSIX
standard.] A separate errno value shall be provided for each thread.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:51:16 -07:00
Max Kellermann
2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann
f987947730 Log: add Log() and LogFormat() overloads with std::exception_ptr
Make LogError()/FormatError() wrappers for those.  Now we can log
exceptions with a lower level.
2019-05-23 12:23:28 +02:00
Max Kellermann
e0d5d88104 Log: make LogLevel the first parameter
Prepare for templated functions.
2019-05-23 12:17:59 +02:00
Max Kellermann
585a745484 Log: use GetFullMessage() to print exceptions
Print all nested exceptions on a single line to avoid confusion.
2019-05-22 18:24:45 +02:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann
377a2860cc Log: add "noexcept" 2017-05-16 10:15:43 +02:00
Max Kellermann
5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann
22dcca9832 util/Error: remove obsolete class 2016-11-10 12:58:26 +01:00
Max Kellermann
a17abc5557 Log: remove the obsolete class Error overloads 2016-11-10 12:55:08 +01:00
Max Kellermann
553365b942 Log: add std::exception_ptr overloads 2016-09-16 17:43:32 +02:00
Max Kellermann
be5d629c13 Log: recognize class Error as nested exception 2016-09-08 20:54:55 +02:00
Max Kellermann
3887465d80 Log: add FormatError() overload with std::exception 2016-09-04 14:34:47 +02:00
Max Kellermann
1aee89f5ea *: include cleanup (using iwyu) 2016-03-01 22:08:13 +01:00
Max Kellermann
1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann
1098d271b8 util/Error: add bridge to std::exception 2015-12-18 00:24:43 +01:00
Max Kellermann
55f95b3ac9 Log: C++ exception support 2015-12-16 00:07:51 +01:00
Max Kellermann
712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann
4f83c60296 copyright year 2014 2014-01-13 22:31:55 +01:00
Max Kellermann
c330d694c7 Log: move Log() to LogBackend.cxx
Prepare for GLib removal.
2013-12-15 17:32:41 +01:00
Max Kellermann
f90abe9530 include cleanup using iwyu 2013-11-28 11:50:54 +01:00
Max Kellermann
ecf12a60e8 Log: add level "DEFAULT"
Map LogLevel::INFO to G_LOG_LEVEL_INFO, and LogLevel::DEFAULT to
G_LOG_LEVEL_MESSAGE.  Now client connect/disconnect message are only
logged on log_level "secure".
2013-11-04 22:27:49 +01:00
Max Kellermann
060814daa8 Log: new logging library API
Prepare to migrate away from GLib.  Currently, we're still using GLib
as a backend.
2013-10-02 08:57:55 +02:00
Max Kellermann
7a4c9f5f4c mpd_error.h: remove obsolete header
Migrate the remaining callers to FatalError().
2013-09-05 18:26:46 +02:00
Max Kellermann
26d92c80ed conf.h: remove obsolete header
Use only ConfigData.hxx in plugin sources to reduce header
dependencies.
2013-09-05 08:47:10 +02:00
Max Kellermann
29030b54c9 util/Error: new error passing library
Replaces GLib's GError.
2013-09-04 18:14:22 +02:00
Max Kellermann
b76a29a69a ConfigPath: return a Path object
Migrate all callers to use Path directly, instead of doing the
conversion in each caller.
2013-08-07 19:59:09 +02:00
Max Kellermann
b70d38dc10 Makefile.am: move sources to libsystem.a 2013-08-07 10:31:31 +02:00
Max Kellermann
a27d105dcd FatalError: new library to replace mpd_error.h 2013-08-07 10:08:36 +02:00
Max Kellermann
85b77b81ca *: use gcc.h macros instead of GLib 2013-08-04 23:48:01 +02:00
Max Kellermann
595b6a4f6c ConfigFile: add enum ConfigOption
Look up top-level config options by enum (= integer), not by name
string.
2013-01-30 21:36:04 +01:00
Max Kellermann
38474961fd Log, ...: include cleanup 2013-01-10 18:34:40 +01:00
Max Kellermann
8eacd13ce7 sig_handlers, log: convert to C++ 2013-01-09 22:33:06 +01:00