RDK Documentation (Open Sourced RDK Components)
rdk_logger_onboard_main.c
1 /*
2 * If not stated otherwise in this file or this component's LICENSE file the
3 * following copyright and licenses apply:
4 *
5 * Copyright 2016 RDK Management
6 *
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
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
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.
18 */
19 #ifdef FEATURE_SUPPORT_ONBOARD_LOGGING
20 #include <stdio.h>
21 #include <string.h>
22 #include <stdarg.h>
23 #include "rdk_debug.h"
24 
25 #define MAX_BUF_SIZE 1024
26 
27 int main( int argc, char **argv)
28 {
29  char msg[MAX_BUF_SIZE];
30  if(argc > 2 && (NULL != argv[1]) && (NULL != argv[2]))
31  {
32  snprintf(msg,sizeof(msg), "%s\n", argv[2]);
33  rdk_log_onboard(argv[1], msg);
34  }
35  else if(argc > 1 && (NULL != argv[1]))
36  {
37  snprintf(msg,sizeof(msg), "%s\n", argv[1]);
38  rdk_log_onboard(NULL, msg);
39  }
40 
41  return 0;
42 }
43 #endif
rdk_debug.h
rdk_log_onboard
void rdk_log_onboard(const char *module, const char *msg,...) __attribute__((format(printf
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will incl...