From 0dd48e83fbc246a881609b4c18ce10001ba1cc1a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 20 Jan 2018 17:31:20 +0000 Subject: Add support for logging via libnslog. Release builds minumum compiled level is warning. Debug builds minimum compiled level is debug. --- src/utils/Makefile | 2 +- src/utils/log.c | 17 +++++++++++++++++ src/utils/log.h | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/utils/log.c create mode 100644 src/utils/log.h (limited to 'src') diff --git a/src/utils/Makefile b/src/utils/Makefile index c317eea..f3fa8fb 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -1,4 +1,4 @@ # Sources -DIR_SOURCES := errors.c utils.c +DIR_SOURCES := errors.c log.c utils.c include $(NSBUILD)/Makefile.subdir diff --git a/src/utils/log.c b/src/utils/log.c new file mode 100644 index 0000000..f16c553 --- /dev/null +++ b/src/utils/log.c @@ -0,0 +1,17 @@ +/* + * This file is part of LibCSS. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2018 Michael Drake + */ + +#include + +#include "utils/log.h" + +NSLOG_DEFINE_CATEGORY(libcss, "LibCSS"); + +NSLOG_DEFINE_SUBCATEGORY(libcss, libcss_selection, "Selection"); + +NSLOG_DEFINE_SUBCATEGORY(libcss_selection, libcss_selection_style_sharing, + "Computed style sharing"); diff --git a/src/utils/log.h b/src/utils/log.h new file mode 100644 index 0000000..6579d92 --- /dev/null +++ b/src/utils/log.h @@ -0,0 +1,19 @@ +/* + * This file is part of LibCSS. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2018 Michael Drake + */ + +#ifndef css_utils_log_h_ +#define css_utils_log_h_ + +#include + +/** Logging sub-category for Selection. */ +NSLOG_DECLARE_CATEGORY(libcss_selection); + +/** Logging sub-category for Selection style sharing. */ +NSLOG_DECLARE_CATEGORY(libcss_selection_style_sharing); + +#endif -- cgit v1.2.3