+++ /dev/null
--------------------------------------------------------------------------------
- NOTICE - Transition to SCONS
--------------------------------------------------------------------------------
-
-The IoTivity build system is transitioning to SCONS. Although the
-makefiles are still available (until v1.0) and some developers are
-still using them, they are currently no longer supported. To learn more
-about building using SCONS see Readme.scons.txt in the repository root
-directory. The build steps used in continuous integration can be found
-in auto_build.sh which is also in the the repository root directory.
-
--------------------------------------------------------------------------------
-
-To run the oc_logger C sample app, first build liboctbstack.a
-
-cd <root>/csdk
-
-To enable logging
-make BUILD=debug
-else
-make BUILD=release
-
-Next, build the oc_logger C sample app
-
-cd <root>/oc_logger/samples/linux
-
-To enable logging
-make BUILD=debug
-else
-make BUILD=release
-
-The logger sample has two options, default logging or
-a custom logger that can be supplied by the user application
-
-To run the application with the default logger, run
-
-./debug/test_logging -c 0
-
-To run the application using a built in custom console logger, run
-
-./debug/test_logging -c 1
-
-
-
+++ /dev/null
-//******************************************************************
-//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-#include "logger.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define TAG ("MAIN")
-
-static int customLogger = 0;
-
-static void PrintUsage()
-{
- OC_LOG(INFO, TAG, "Usage : test_logging -c <0|1>");
- OC_LOG(INFO, TAG, "-u <0|1> : 0 - default logging, 1 - custom console logging");
-}
-
-int main(int argc, char* argv[])
-{
- int opt;
-
- while ((opt = getopt(argc, argv, "c:")) != -1)
- {
- switch(opt)
- {
- case 'c':
- customLogger = atoi(optarg);
- break;
- default:
- PrintUsage();
- return -1;
- }
- }
-
- if (customLogger == 0)
- {
- // Default logger
- OC_LOG(DEBUG, TAG, "This is a DEBUG");
- OC_LOG(INFO, TAG, "This is a INFO");
- OC_LOG(WARNING, TAG, "This is a WARNING");
- OC_LOG(ERROR, TAG, "This is a ERROR");
- OC_LOG(FATAL, TAG, "This is a FATAL");
- }
- else
- {
- // Custom logger, in this case, the console logger
- oc_log_ctx_t *log = oc_make_console_logger();
-
- OC_LOG_CONFIG(log);
-
- OC_LOG(DEBUG, TAG, "This is a DEBUG");
- OC_LOG(INFO, TAG, "This is a INFO");
- OC_LOG(WARNING, TAG, "This is a WARNING");
- OC_LOG(ERROR, TAG, "This is a ERROR");
- OC_LOG(FATAL, TAG, "This is a FATAL");
- OC_LOG_SHUTDOWN();
- }
-
-
- return 0;
-}