1 //******************************************************************
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Do not remove the include below
8 #include "ArduinoLoggerTest.h"
11 const prog_char tag[] PROGMEM = "Arduino";
12 const prog_char msg[] PROGMEM = "Arduino Logger Test";
14 const prog_char debugMsg[] PROGMEM = "this is a DEBUG message";
15 const prog_char infoMsg[] PROGMEM = "this is a INFO message";
16 const prog_char warningMsg[] PROGMEM = "this is a WARNING message";
17 const prog_char errorMsg[] PROGMEM = "this is a ERROR message";
18 const prog_char fatalMsg[] PROGMEM = "this is a FATAL message";
20 const prog_char multiLineMsg[] PROGMEM = "this is a DEBUG message\non multiple\nlines";
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
27 OC_LOG(INFO, tag, msg);
43 OC_LOG(DEBUG, tag, debugMsg);
44 OC_LOG(INFO, tag, infoMsg);
45 OC_LOG(WARNING, tag, warningMsg);
46 OC_LOG(ERROR, tag, errorMsg);
47 OC_LOG(FATAL, tag, fatalMsg);
51 OC_LOG(DEBUG, tag, multiLineMsg);
58 for (int i = 0; i < (int)(sizeof buffer); i++) {
61 OC_LOG_BUFFER(DEBUG, tag, buffer, sizeof buffer);
63 // Log buffer, 128 bytes is a good boundary (8 rows of 16 values)
65 for (int i = 0; i < (int)(sizeof buffer1); i++) {
68 OC_LOG_BUFFER(DEBUG, tag, buffer1, sizeof buffer1);
70 // 1 below 128 byte boundary
72 for (int i = 0; i < (int)(sizeof buffer2); i++) {
75 OC_LOG_BUFFER(DEBUG, tag, buffer2, sizeof buffer2);
77 // 1 above 128 byte boundary
79 for (int i = 0; i < (int)(sizeof buffer3); i++) {
82 OC_LOG_BUFFER(DEBUG, tag, buffer3, sizeof buffer3);
85 //The setup function is called once at startup of the sketch
88 // Add your initialization code here
107 // The loop function is called in an endless loop