diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-07-17 14:00:26 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2015-07-17 14:00:26 +0200 |
commit | 004e25a7afe080bdaddb19e48e426672e6e73479 (patch) | |
tree | a9e0cc003691fbfbe721fe58bf6ff8a3b0621e1c /matlab/mex | |
parent | ba092a5602abba8b1a4bd17988dee6b567f02b7a (diff) | |
parent | 4d39c35d6c9124c26de64c9d227a25f612903a2a (diff) | |
download | astra-004e25a7afe080bdaddb19e48e426672e6e73479.tar.gz astra-004e25a7afe080bdaddb19e48e426672e6e73479.tar.bz2 astra-004e25a7afe080bdaddb19e48e426672e6e73479.tar.xz astra-004e25a7afe080bdaddb19e48e426672e6e73479.zip |
Merge pull request #84 from dmpelt/log-highlevel-fix
Fix formatting when passing strings to log from high-level code
Diffstat (limited to 'matlab/mex')
-rw-r--r-- | matlab/mex/astra_mex_log_c.cpp | 8 | ||||
-rw-r--r-- | matlab/mex/mexInitFunctions.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/matlab/mex/astra_mex_log_c.cpp b/matlab/mex/astra_mex_log_c.cpp index ea4621e..905612c 100644 --- a/matlab/mex/astra_mex_log_c.cpp +++ b/matlab/mex/astra_mex_log_c.cpp @@ -55,7 +55,7 @@ void astra_mex_log_debug(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prh string filename = mexToString(prhs[1]); int linenumber = (int)mxGetScalar(prhs[2]); string message = mexToString(prhs[3]); - astra::CLogger::debug(filename.c_str(),linenumber,message.c_str()); + astra::CLogger::debug(filename.c_str(),linenumber,"%s",message.c_str()); } //----------------------------------------------------------------------------------------- @@ -75,7 +75,7 @@ void astra_mex_log_info(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs string filename = mexToString(prhs[1]); int linenumber = (int)mxGetScalar(prhs[2]); string message = mexToString(prhs[3]); - astra::CLogger::info(filename.c_str(),linenumber,message.c_str()); + astra::CLogger::info(filename.c_str(),linenumber,"%s",message.c_str()); } //----------------------------------------------------------------------------------------- @@ -95,7 +95,7 @@ void astra_mex_log_warn(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs string filename = mexToString(prhs[1]); int linenumber = (int)mxGetScalar(prhs[2]); string message = mexToString(prhs[3]); - astra::CLogger::warn(filename.c_str(),linenumber,message.c_str()); + astra::CLogger::warn(filename.c_str(),linenumber,"%s",message.c_str()); } //----------------------------------------------------------------------------------------- @@ -115,7 +115,7 @@ void astra_mex_log_error(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prh string filename = mexToString(prhs[1]); int linenumber = (int)mxGetScalar(prhs[2]); string message = mexToString(prhs[3]); - astra::CLogger::error(filename.c_str(),linenumber,message.c_str()); + astra::CLogger::error(filename.c_str(),linenumber,"%s",message.c_str()); } //----------------------------------------------------------------------------------------- diff --git a/matlab/mex/mexInitFunctions.cpp b/matlab/mex/mexInitFunctions.cpp index d8a50d7..89a31a1 100644 --- a/matlab/mex/mexInitFunctions.cpp +++ b/matlab/mex/mexInitFunctions.cpp @@ -8,7 +8,7 @@ bool mexIsInitialized=false; * */ void logCallBack(const char *msg, size_t len){ - mexPrintf(msg); + mexPrintf("%s",msg); } /** |