4 * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * @desc Contains API to create logd events.
24 #ifndef _LOGD_ACTIVITY_LOGGING_H_
25 #define _LOGD_ACTIVITY_LOGGING_H_
29 #define LOGD_SHIFT_ACTION(action) ((action) << 16)
76 * enum logd_power_mode must be 3rd parameter
77 * for LOGD_POWER_MODE | LOGD_CHANGED event
79 enum logd_power_mode {
80 LOGD_POWER_MODE_NORMAL,
81 LOGD_POWER_MODE_POWERFUL,
82 LOGD_POWER_MODE_EMERGENCY,
83 LOGD_POWER_MODE_MAX, /* it's fake power mode, don't use it */
84 LOGD_POWER_MODE_CHARGED, /* it's fake power mode, don't use it */
89 LOGD_ERROR_INVALID_PARAM,
94 * Create new logd event, that will be sent to logd_grabber and stored in DB.
96 * @param object Object that was changed.
97 * @param action Type of event that occured with object.
98 * @param ... Message that clarify event's parameter. Required not for all
99 * event type. It can be <CODE>int</CODE> or <CODE>char*</CODE> depends on
100 * <CODE>object</CODE> and <CODE>action</CODE>.
101 * object=LOGD_BATTERY_SOC and action=LOGD_CHANGED, data=[battary level] (int)
102 * object=LOGD_DISPLAY and action=LOGD_CHANGED, data=[brigthness level] (int)
103 * object=LOGD_FOREGRD_APP and action=LOGD_CHANGED, data=[new foregraund appl] (char*)
104 * @return On success, LOGD_ERROR_OK. On error, other value from
105 * <CODE>enum logd_error</CODE>
109 * logd_event(LOGD_WIFI, LOGD_ON);
110 * logd_event(LOGD_FOREGRD_APP, LOGD_CHANGED, "browser");
113 int logd_event(enum logd_object object, enum logd_action action, ...);
119 #endif /* _LOGD_ACTIVITY_LOGGING_H_ */