-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlog.hpp
More file actions
46 lines (38 loc) · 1.55 KB
/
log.hpp
File metadata and controls
46 lines (38 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright (c) AppDynamics, Inc., and its affiliates
* 2017
*
* 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.
*/
#ifndef _LOG_HPP
#define _LOG_HPP
/**
* @brief Opens Log file in write mode. If log file doesn't exist, a new one is created.
* @param logfilename indicates the name of the log file to be opened.
*/
void open_log(const char* logfilename);
/**
* @brief Prefixes Log Message with timestamp and writes to log file pointed by global_fd. <br>
* open_log() has to be called before log_write_cb function is triggered.
* @param logmsg contains the log message without the newline char at the end <br>
* logmsg is appended with a tag "E/APPDYNAMICS:". First Letter in the tag <br>
* indicates log level as given in appd_iot_log_level_t. <br>
* logmsg not to be freed in the log write callback. It is freed by the caller of log write cb.
* @param logmsg_len contains the length of log message
*/
void log_write_cb(const char* logmsg, size_t logmsg_len);
/**
* @brief Closes Log File if opened and sets FD to -1
*/
void close_log();
#endif /* _LOG_HPP */