{"id":110,"date":"2008-05-27T16:08:59","date_gmt":"2008-05-27T15:08:59","guid":{"rendered":"http:\/\/www.ozone3d.net\/blogs\/lab\/?p=110"},"modified":"2014-02-01T14:03:57","modified_gmt":"2014-02-01T13:03:57","slug":"small-log-system","status":"publish","type":"post","link":"https:\/\/www.ozone3d.net\/blogs\/lab\/20080527\/small-log-system\/","title":{"rendered":"Small Log System"},"content":{"rendered":"<p>Here is a small piece of code that can be useful if you need to quickly generate traces (or log) in your apps:<\/p>\n<pre>\r\nclass cLog\r\n{\r\npublic:\r\n  cLog(char *logfile){};\r\n  static void trace(const char *s)\r\n  { if(s) log &lt;&lt;  s &lt;&lt; std::endl; };\r\n  static std::ofstream log;\r\n};\r\nstd::ofstream cLog::log(\"c:\\\\app_log.txt\");\r\n<\/pre>\n<p>Just use it as follows:<\/p>\n<pre>\r\ncLog::trace(\"this is a log\");\r\ncLog::trace(\"this is a second trace\");\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is a small piece of code that can be useful if you need to quickly generate traces (or log) in your apps: class cLog { public: cLog(char *logfile){}; static void trace(const char *s) { if(s) log &lt;&lt; s &lt;&lt; std::endl; }; static std::ofstream log; }; std::ofstream cLog::log(&#8220;c:\\\\app_log.txt&#8221;); Just use it as follows: cLog::trace(&#8220;this is a log&#8221;); cLog::trace(&#8220;this is a second trace&#8221;);<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[112,292,637,293],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-programming","tag-c","tag-log","tag-programming","tag-trace"],"aioseo_notices":[],"views":536,"_links":{"self":[{"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":0,"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ozone3d.net\/blogs\/lab\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}