Soletta machine learning
Machine learning for IoT devices
All
Data Structures
Files
Functions
Typedefs
Enumerations
Enumerator
Groups
Pages
home
tipbot
tipbot-workdir
soletta-machine-learning
sml
include
sml_log.h
Go to the documentation of this file.
1
/*
2
* This file is part of the Soletta Project
3
*
4
* Copyright (C) 2015 Intel Corporation. All rights reserved.
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
19
#pragma once
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
36
enum
sml_log_level
{
37
SML_LOG_LEVEL_DEBUG
= 1 << 0,
38
SML_LOG_LEVEL_INFO
= 1 << 1,
39
SML_LOG_LEVEL_WARNING
= 1 << 2,
40
SML_LOG_LEVEL_ERROR
= 1 << 3,
41
SML_LOG_LEVEL_CRITICAL
= 1 << 4,
42
SML_LOG_LEVEL_ALL
= (
SML_LOG_LEVEL_DEBUG
|
SML_LOG_LEVEL_INFO
|
SML_LOG_LEVEL_WARNING
|
SML_LOG_LEVEL_ERROR
|
SML_LOG_LEVEL_CRITICAL
)
43
};
57
typedef
void (*
sml_log_handler_cb
)(
enum
sml_log_level
level,
const
char
*msg,
void
*data);
58
74
void
sml_log_set_log_handler
(
enum
sml_log_level
levels,
sml_log_handler_cb
cb,
void
*data);
75
83
void
sml_log_print
(
enum
sml_log_level
level,
const
char
*format, ...);
84
92
#define sml_debug(...) sml_log_print(SML_LOG_LEVEL_DEBUG, __VA_ARGS__)
93
101
#define sml_info(...) sml_log_print(SML_LOG_LEVEL_INFO, __VA_ARGS__)
102
110
#define sml_warning(...) sml_log_print(SML_LOG_LEVEL_WARNING, __VA_ARGS__)
111
119
#define sml_error(...) sml_log_print(SML_LOG_LEVEL_ERROR, __VA_ARGS__)
120
128
#define sml_critical(...) sml_log_print(SML_LOG_LEVEL_CRITICAL, __VA_ARGS__)
129
133
#ifdef __cplusplus
134
}
135
#endif
sml_log_handler_cb
void(* sml_log_handler_cb)(enum sml_log_level level, const char *msg, void *data)
Log handler callback.
Definition:
sml_log.h:57
sml_log_set_log_handler
void sml_log_set_log_handler(enum sml_log_level levels, sml_log_handler_cb cb, void *data)
Set a log handler.
SML_LOG_LEVEL_INFO
Definition:
sml_log.h:38
SML_LOG_LEVEL_CRITICAL
Definition:
sml_log.h:41
sml_log_print
void sml_log_print(enum sml_log_level level, const char *format,...)
Prints a message with a desired log level.
SML_LOG_LEVEL_ERROR
Definition:
sml_log.h:40
SML_LOG_LEVEL_ALL
Definition:
sml_log.h:42
SML_LOG_LEVEL_WARNING
Definition:
sml_log.h:39
sml_log_level
sml_log_level
Log level types.
Definition:
sml_log.h:36
SML_LOG_LEVEL_DEBUG
Definition:
sml_log.h:37
Generated by
1.8.6