Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions deps/node/src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1171,5 +1171,24 @@ napi_status napi_get_context(napi_env env, napi_context& context) {
context = *v8Context;
return napi_ok;
}

#if defined(HOST_TIZEN)
#include "dlog.h"
NAPI_EXTERN void napi_fatal_log(const char* tag, const char* message) {
dlog_print(DLOG_FATAL, tag, "%s", message);
}

NAPI_EXTERN void napi_info_log(const char* tag, const char* message) {
dlog_print(DLOG_INFO, tag, "%s", message);
}
#else
NAPI_EXTERN void napi_fatal_log(const char* tag, const char* message) {
fprintf(stderr, "%s\n", tag, message);
}

NAPI_EXTERN void napi_info_log(const char* tag, const char* message) {
fprintf(stdout, "%s\n", tag, message);
}
#endif
#endif
//end of @lwnode
5 changes: 5 additions & 0 deletions deps/node/src/node_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(

#endif // NAPI_EXPERIMENTAL

//@lwnode
NAPI_EXTERN void napi_fatal_log(const char* tag, const char* message);
NAPI_EXTERN void napi_info_log(const char* tag, const char* message);


EXTERN_C_END

#endif // SRC_NODE_API_H_
1 change: 1 addition & 0 deletions deps/node/src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ void Logger(const FunctionCallbackInfo<Value>& args) {
args[1]->Int32Value(env->context()).FromJust() == 2) {
// stderr
LWNODE_DEV_FATAL_LOG(message.ToString().c_str());
FPrintF(stderr, "%s", message);
} else {
FPrintF(stderr, "%s", message);
}
Expand Down