1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 // Do not remove the include below
23 #include "ArduinoLoggerTest.h"
27 #define msg "Arduino Logger Test"
29 #define debugMsg "this is a DEBUG message"
30 #define infoMsg "this is a INFO message"
31 #define warningMsg "this is a WARNING message"
32 #define errorMsg "this is a ERROR message"
33 #define fatalMsg "this is a FATAL message"
35 #define multiLineMsg "this is a DEBUG message\non multiple\nlines"
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
42 OC_LOG(INFO, tag, msg);
58 OC_LOG(DEBUG, tag, debugMsg);
59 OC_LOG(INFO, tag, infoMsg);
60 OC_LOG(WARNING, tag, warningMsg);
61 OC_LOG(ERROR, tag, errorMsg);
62 OC_LOG(FATAL, tag, fatalMsg);
66 OC_LOG(DEBUG, tag, multiLineMsg);
73 for (int i = 0; i < (int)(sizeof buffer); i++) {
76 OC_LOG_BUFFER(DEBUG, tag, buffer, sizeof buffer);
78 // Log buffer, 128 bytes is a good boundary (8 rows of 16 values)
80 for (int i = 0; i < (int)(sizeof buffer1); i++) {
83 OC_LOG_BUFFER(DEBUG, tag, buffer1, sizeof buffer1);
85 // 1 below 128 byte boundary
87 for (int i = 0; i < (int)(sizeof buffer2); i++) {
90 OC_LOG_BUFFER(DEBUG, tag, buffer2, sizeof buffer2);
92 // 1 above 128 byte boundary
94 for (int i = 0; i < (int)(sizeof buffer3); i++) {
97 OC_LOG_BUFFER(DEBUG, tag, buffer3, sizeof buffer3);
100 //The setup function is called once at startup of the sketch
103 // Add your initialization code here
122 // The loop function is called in an endless loop