{"action":"created","issue":{"url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/issues/27","repository_url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform","labels_url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/issues/27/comments","events_url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/issues/27/events","html_url":"https://github.com/Move38/Move38-Arduino-Platform/pull/27","id":349608647,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3Njg0NDAy","number":27,"title":"Updated per discussion: simpler, shields impl, pushes macros","user":{"login":"kenj1","id":2472457,"node_id":"MDQ6VXNlcjI0NzI0NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/2472457?v=4","gravatar_id":"","url":"https://api.github.com/users/kenj1","html_url":"https://github.com/kenj1","followers_url":"https://api.github.com/users/kenj1/followers","following_url":"https://api.github.com/users/kenj1/following{/other_user}","gists_url":"https://api.github.com/users/kenj1/gists{/gist_id}","starred_url":"https://api.github.com/users/kenj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenj1/subscriptions","organizations_url":"https://api.github.com/users/kenj1/orgs","repos_url":"https://api.github.com/users/kenj1/repos","events_url":"https://api.github.com/users/kenj1/events{/privacy}","received_events_url":"https://api.github.com/users/kenj1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-10T18:08:00Z","updated_at":"2018-08-19T19:51:11Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/pulls/27","html_url":"https://github.com/Move38/Move38-Arduino-Platform/pull/27","diff_url":"https://github.com/Move38/Move38-Arduino-Platform/pull/27.diff","patch_url":"https://github.com/Move38/Move38-Arduino-Platform/pull/27.patch"},"body":"(Copy/paste partial from LogSerial.h comment)\r\n---\r\nSummary of LogSerial functionality:\r\n\r\nSupports a \"printf\" style formatting (fprintf) with a variable number of arguments.  \r\nSimple setup and access to logging via macros (i.e. implementation detail knowledge not required)\r\nProvides five increasing log levels: LOG_NONE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG (or LOG_ALL).\r\nCustomizable header string per macro type.\r\nLog messages can be compiled away at graduated log levels (reducing sketch size for non-debug compilation)\r\nAll LogSerial functionality can be compiled away with a single line change.\r\nCan store formats string in Flash memory (efficient space saving).\r\nSupports either 250k or 500k (default) baud rate for the Serial Monitor port. (VSCode max is 250k)\r\n\r\nNote: LogSerial does not preclude the use of the ServicePortSerial class or methods.  \r\nHowever, to realize the above benefits, users should transition to using LogSerial. \r\n\r\nTo use LogSerial functionality:\r\n 1) Define a USE_LOG_LEVEL and value at the beginning of your sketch (before the Include file).\r\n 2) Include \"LogSerial.h\"\r\n 3) Call the LOG_SERIAL_BEGIN macro in your setup method (with baudrate, or empty (default to 500k))\r\n 4) Use the appropriate LogSerial macro's\r\n\r\nDefining USE_LOG_LEVEL (examples):\r\nTo include all log levels, define USE_LOG_LEVEL to LOG_DEBUG (or LOG_ALL).\r\nTo only include errors, set USE_LOG_LEVEL to LOG_ERROR.  (All other log messages are compiled away.)\r\nTo only include errors and warnings, set USE_LOG_LEVEL to LOG_WARN. (Info and Debug log messages are compiled away.)\r\nTo compile away all LogSerial macros, either do not define USE_LOG_LEVEL or set its value to LOG_NONE.\r\n\r\nLogSerial Macros:\r\nThe LogSerial macro composition: \r\n  // macroName( formatString, variableArgs)\r\n  LOGx ( formatString, ...)\r\n\r\nThere are 2 sets of macros;\r\n \r\nUse your format string as-is:\r\n LOG - Always log\r\n LOGE - Log an error message\r\n LOGW - Log a warning message\r\n LOGI - Log an informational message\r\n LOGD - Log a debug message\r\n \r\nStores your format string in Flash memory (Note, 'F' at end of Macro name):\r\n LOGF - Always log\r\n LOGEF - Log an error message\r\n LOGWF - Log a warning message\r\n LOGIF - Log an informational message\r\n LOGDF - Log a debug message\r\n\r\n// My sketch - can use LogSerial w/o needing to know implementation\r\n// To compile in only ERRORs and WARNINGs\r\n#define USE_LOG_LEVEL LOG_WARN\r\n\r\n#include \"LogSerial.h\"\r\n\r\nvoid setup() {\r\n  LOG_SERIAL_BEGIN();\r\n}\r\n\r\nvoid loop() {\r\n...\r\nLOGEF(\"[%lu] Starting value was %d, should've been %d\\n\", millis(), newValue, origValue);\r\n...\r\n// Info message (compiled away unless USE_LOG_LEVEL is at least LOG_INFO)\r\nLOGIF(\"Message received: %s [%x]\\n\", newMessage, hexValue);\r\n}"},"comment":{"url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/issues/comments/414151456","html_url":"https://github.com/Move38/Move38-Arduino-Platform/pull/27#issuecomment-414151456","issue_url":"https://api.github.com/repos/Move38/Move38-Arduino-Platform/issues/27","id":414151456,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDE1MTQ1Ng==","user":{"login":"kenj1","id":2472457,"node_id":"MDQ6VXNlcjI0NzI0NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/2472457?v=4","gravatar_id":"","url":"https://api.github.com/users/kenj1","html_url":"https://github.com/kenj1","followers_url":"https://api.github.com/users/kenj1/followers","following_url":"https://api.github.com/users/kenj1/following{/other_user}","gists_url":"https://api.github.com/users/kenj1/gists{/gist_id}","starred_url":"https://api.github.com/users/kenj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenj1/subscriptions","organizations_url":"https://api.github.com/users/kenj1/orgs","repos_url":"https://api.github.com/users/kenj1/repos","events_url":"https://api.github.com/users/kenj1/events{/privacy}","received_events_url":"https://api.github.com/users/kenj1/received_events","type":"User","site_admin":false},"created_at":"2018-08-19T19:51:11Z","updated_at":"2018-08-19T19:51:11Z","author_association":"NONE","body":"I modified it per feedback so that it's easier to use and can be compiled away.  Given that it's mostly macro's (no real code details required other than one #define and the #include), the hope is that it'd be significantly easier.  With the bonus that it can be compiled away easily, and it's efficient on memory (i.e. using PROGMEM for the format string).  And it works with VSCode (250k baud rate).\r\n\r\nMy thought is that If a user is going to be using the Serial Monitor (at all) for debug, than this will make their life easier than the repeated \"print\" and \"println\" methods. \r\n\r\nThanks for checking it out."}}
{"actor":{"display_login":"kenj1"}}