Make logging an optional feature and disable it by default (#2449)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-08-08 16:35:03 +02:00
committed by yichoi
parent 58c568a68f
commit 29f6ffc35b
10 changed files with 59 additions and 6 deletions
+1
View File
@@ -91,6 +91,7 @@ typedef enum
JERRY_FEATURE_DATE, /**< Date support */
JERRY_FEATURE_REGEXP, /**< Regexp support */
JERRY_FEATURE_LINE_INFO, /**< line info available */
JERRY_FEATURE_LOGGING, /**< logging */
JERRY_FEATURE__COUNT /**< number of features. NOTE: must be at the end of the list */
} jerry_feature_t;
+5
View File
@@ -97,6 +97,11 @@ typedef enum
*
* Example: a libc-based port may implement this with vfprintf(stderr) or
* vfprintf(logfile), or both, depending on log level.
*
* Note:
* This port function is called by jerry-core when JERRY_ENABLE_LOGGING is
* defined. It is also common practice though to use this function in
* application code.
*/
void JERRY_ATTR_FORMAT (printf, 2, 3) jerry_port_log (jerry_log_level_t level, const char *format, ...);