From 8cfe6ab75ede2eee7d101792eaed68cc1ded69ca Mon Sep 17 00:00:00 2001 From: Matthew-Supernaw-NOAA Date: Tue, 7 May 2024 14:00:54 -0400 Subject: [PATCH] update --- .../include/interface/rcpp/rcpp_interface.hpp | 6 +- test/fims.log | 63 +++++++++++-------- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/inst/include/interface/rcpp/rcpp_interface.hpp b/inst/include/interface/rcpp/rcpp_interface.hpp index 67b3989..d054bfb 100644 --- a/inst/include/interface/rcpp/rcpp_interface.hpp +++ b/inst/include/interface/rcpp/rcpp_interface.hpp @@ -118,14 +118,14 @@ void InitLogging(){ * Add log info entry from R. */ void LogInfo(std::string log_entry){ - FIMSLog::fims_log->message(log_entry, -999, "R_env", "R_script_entry"); + FIMSLog::fims_log->message(log_entry, -1, "R_env", "R_script_entry"); } /** * Add log warning entry from R. */ void LogWarning(std::string log_entry){ - FIMSLog::fims_log->warning_message(log_entry, -999, "R_env", "R_script_entry"); + FIMSLog::fims_log->warning_message(log_entry, -1, "R_env", "R_script_entry"); } /** @@ -160,7 +160,7 @@ void LogError(std::string log_entry){ // Rcpp::Environment base = Rcpp::Environment::global_env(); // Rcpp::Function f = base["traceback"]; // std::string ret = Rcpp::as(f()); - FIMSLog::fims_log->error_message(log_entry, -999, "R_env", ret.c_str()); + FIMSLog::fims_log->error_message(log_entry, -1, "R_env", ret.c_str()); } /** diff --git a/test/fims.log b/test/fims.log index 35a11da..46859a9 100644 --- a/test/fims.log +++ b/test/fims.log @@ -1,6 +1,6 @@ [ { -"timestamp" : "Mon May 6 11:32:19 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "Initializing FIMS logging system.", "id" : "0", @@ -11,21 +11,32 @@ "line" : "108" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", -"message" : "CreateModel: 2 instantiated model objects.", +"message" : "Setting FIMS write log: 1", "id" : "1", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_interface.hpp", +"routine" : "void WriteLog(bool)", +"line" : "85" +}, +{ +"timestamp" : "Tue May 7 13:13:23 2024", +"level" : "info", +"message" : "CreateModel: 2 instantiated model objects.", +"id" : "2", +"user" : "mattadmin", +"wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", +"file" : "./../inst/include/interface/rcpp/rcpp_interface.hpp", "routine" : "bool CreateModel()", "line" : "11" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "vonBertalanffyInterface::prepare.", -"id" : "2", +"id" : "3", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp", @@ -33,10 +44,10 @@ "line" : "106" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "vonBertalanffyInterface::prepare_local.", -"id" : "3", +"id" : "4", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp", @@ -44,10 +55,10 @@ "line" : "54" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "vonBertalanffyInterface::prepare_local.", -"id" : "4", +"id" : "5", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp", @@ -55,10 +66,10 @@ "line" : "54" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "vonBertalanffyInterface::prepare_local.", -"id" : "5", +"id" : "6", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp", @@ -66,10 +77,10 @@ "line" : "54" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "vonBertalanffyInterface::prepare_local.", -"id" : "6", +"id" : "7", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp", @@ -77,10 +88,10 @@ "line" : "54" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "vonBertalanffyInterface::finalize.", -"id" : "7", +"id" : "8", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", "file" : "./../inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp", @@ -88,36 +99,38 @@ "line" : "123" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "info", "message" : "test info callback", -"id" : "8", +"id" : "9", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", -"file" : "R_callback", +"file" : "R_env", "routine" : "R_script_entry", "line" : "-999" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "warning", "message" : "test warning callback", -"id" : "9", +"id" : "10", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", -"file" : "R_callback", +"file" : "R_env", "routine" : "R_script_entry", "line" : "-999" }, { -"timestamp" : "Mon May 6 11:32:20 2024", +"timestamp" : "Tue May 7 13:13:23 2024", "level" : "error", "message" : "test error callback", -"id" : "10", +"id" : "11", "user" : "mattadmin", "wd" : "/Users/mattadmin/ModularTMBExample/logging-refactor/ModularTMBExample/test", -"file" : "R_callback", -"routine" : "R_script_entry", +"file" : "R_env", +"routine" : "traceback: +No traceback available +", "line" : "-999" } ] \ No newline at end of file