Add logging support for linux.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-05-18 22:00:30 +03:00
parent 0c058747f1
commit d6c9c5911e
7 changed files with 129 additions and 5 deletions
+15 -2
View File
@@ -71,6 +71,11 @@ static bool jerry_api_available;
*/
char jerry_extension_characters_buffer[CONFIG_EXTENSION_CHAR_BUFFER_SIZE];
#ifdef JERRY_ENABLE_LOG
int jerry_debug_level = 0;
FILE *jerry_log_file = nullptr;
#endif
/**
* Assert that it is correct to call API in current state.
*
@@ -1119,6 +1124,13 @@ jerry_api_eval (const char *source_p, /**< source code */
void
jerry_init (jerry_flag_t flags) /**< combination of Jerry flags */
{
if (flags & (JERRY_FLAG_ENABLE_LOG))
{
#ifndef JERRY_ENABLE_LOG
JERRY_WARNING_MSG ("Ignoring log options because of '!JERRY_ENABLE_LOG' build configuration.\n");
#endif
}
if (flags & (JERRY_FLAG_MEM_STATS))
{
#ifndef MEM_STATS
@@ -1126,14 +1138,15 @@ jerry_init (jerry_flag_t flags) /**< combination of Jerry flags */
| JERRY_FLAG_MEM_STATS_PER_OPCODE
| JERRY_FLAG_MEM_STATS_SEPARATE);
printf ("Ignoring memory statistics option because of '!MEM_STATS' build configuration.\n");
JERRY_WARNING_MSG ("Ignoring memory statistics option because of '!MEM_STATS' build configuration.\n");
#endif /* !MEM_STATS */
}
else if (flags & (JERRY_FLAG_MEM_STATS_PER_OPCODE | JERRY_FLAG_MEM_STATS_SEPARATE))
{
flags &= ~(JERRY_FLAG_MEM_STATS_PER_OPCODE | JERRY_FLAG_MEM_STATS_SEPARATE);
printf ("Ignoring detailed memory statistics options because memory statistics dump mode is not enabled.\n");
JERRY_WARNING_MSG (
"Ignoring detailed memory statistics options because memory statistics dump mode is not enabled.\n");
}
jerry_flags = flags;