1 //******************************************************************
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
11 static const char tag[] = "Android";
12 static const char msg[] = "Android Logger Test";
14 static const char debugMsg[] = "this is a DEBUG message";
15 static const char infoMsg[] = "this is a INFO message";
16 static const char warningMsg[] = "this is a WARNING message";
17 static const char errorMsg[] = "this is a ERROR message";
18 static const char fatalMsg[] = "this is a FATAL message";
20 static const char multiLineMsg[] = "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);
86 OC_LOG_V(DEBUG, tag, "this is a char: %c", 'A');
87 OC_LOG_V(DEBUG, tag, "this is an integer: %d", 123);
88 OC_LOG_V(DEBUG, tag, "this is a string: %s", "hello");
89 OC_LOG_V(DEBUG, tag, "this is a float: %5.2f", 123.45);
92 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
96 OC_LOG(INFO, tag, "Starting logger test");