icwmp/inc/log.h
Mohamed Kallel 27b73d5af7 PIVA::DELIVERY 8
script optimization
Voice parameters: AddObject/DeleteObject
Voice parameters: Vendor specific parameter

Concerning what we did in the optimization task:
1)  The main script  (freecwmp) is loaded only 1 time during the session. the load is done just before the start of the session. the function scripts are loaded within the load of the main script (freecwmp) only one time. The old behaviour consist to load the main script (freecwmp) and the function scripts for each parameter treatment. Core code (C) and Scripts are changed
2) Optimize the preparing of inform message. old script take ~30s and now it takes ~2s. Core code (C) and Scripts are changed
3) Execute only the function related to the parameter. For example if the requested parameter is "InternetGatewayDevice.ManagementServer.URL" then the main script freecwmp will execute only the related function of this parameter which is get_management_server(). The old behaviour consist to execute all get functions: get_wan_device(), get_lan_device(), get_device_info()...
4) Minimize the size of the script files: Replace some blocks o othe source code by a functions
2013-07-24 16:05:32 +01:00

61 lines
1.4 KiB
C

/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2013 Inteno Broadband Technology AB
* Author Mohamed Kallel <mohamed.kallel@pivasoftware.com>
* Author Ahmed Zribi <ahmed.zribi@pivasoftware.com>
*
*/
#ifndef _LOG_H_
#define _LOG_H_
enum log_severity_enum {
EMERG,
ALERT,
CRITIC,
ERROR,
WARNING,
NOTICE,
INFO,
DEBUG
};
#define DEFAULT_LOG_FILE_SIZE 10240
#define DEFAULT_LOG_FILE_NAME "/var/log/cwmpd.log"
#define DEFAULT_LOG_SEVERITY INFO
#ifdef WITH_CWMP_DEBUG
# ifndef CWMP_LOG
# define CWMP_LOG(SEV,MESSAGE,args...) puts_log(SEV,MESSAGE,##args);
# endif
#else
# define CWMP_LOG(SEV,MESSAGE,args...)
#endif
#ifdef WITH_DEV_DEBUG
# ifndef DD
# define DD(SEV,MESSAGE,args...) puts_log(SEV,MESSAGE,##args);
# endif
#else
# define DD(SEV,MESSAGE,args...)
#endif
#define DETECT_CRASH(MESSAGE,args...) { \
const char *A[] = {MESSAGE}; \
printf("step: %s %s %d\n",__FUNCTION__,__FILE__,__LINE__); fflush(stdout); sleep(1);\
if(sizeof(A) > 0) \
printf(*A,##args); \
}
#define TRACE(MESSAGE,args...) { \
const char *A[] = {MESSAGE}; \
printf("step: %s %s %d\n",__FUNCTION__,__FILE__,__LINE__); fflush(stdout);\
if(sizeof(A) > 0) \
printf(*A,##args); \
}
#endif /* _LOG_H_ */