Open Deep Learning API
Loading...
Searching...
No Matches
ODLA
odla_log.h
Go to the documentation of this file.
1
//===- odla_log.h ---------------------------------------------------------===//
2
//
3
// Copyright (C) 2019-2022 Alibaba Group Holding Limited.
4
//
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
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
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.
16
// =============================================================================
17
18
#ifndef _ODLA_LOG_H_
19
#define _ODLA_LOG_H_
20
21
#include <
ODLA/odla_common.h
>
22
27
#ifdef __cplusplus
28
extern
"C"
{
29
#endif
30
32
typedef
enum
{
33
ODLA_LOG_LEVEL_OFF,
34
ODLA_LOG_LEVEL_FATAL,
35
ODLA_LOG_LEVEL_ERROR,
36
ODLA_LOG_LEVEL_WARN,
37
ODLA_LOG_LEVEL_INFO,
38
ODLA_LOG_LEVEL_DEBUG,
39
ODLA_LOG_LEVEL_TRACE,
40
}
odla_log_level
;
41
43
typedef
void (*
odla_logging_func
)(
const
char
* file_name,
int
line,
44
const
char
* func_name,
odla_log_level
level,
45
const
char
* msg);
47
52
extern
ODLA_API_EXPORT
odla_status
ODLA_API_CALL
53
odla_SetLogLevel
(
odla_log_level
level);
54
56
61
extern
ODLA_API_EXPORT
odla_status
ODLA_API_CALL
62
odla_SetLogger
(
odla_logging_func
logger);
63
65
68
extern
ODLA_API_EXPORT
odla_logging_func
ODLA_API_CALL
odla_GetLogger
();
69
70
#ifdef __cplusplus
71
}
// C extern
72
#endif
73
74
#endif
// _ODLA_LOG_H_
odla_common.h
ODLA_API_EXPORT
#define ODLA_API_EXPORT
API export directives.
Definition:
odla_common.h:172
odla_status
odla_status
Return status.
Definition:
odla_common.h:140
odla_GetLogger
ODLA_API_EXPORT odla_logging_func ODLA_API_CALL odla_GetLogger()
Get active logger.
odla_SetLogger
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetLogger(odla_logging_func logger)
Set active logger.
odla_SetLogLevel
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetLogLevel(odla_log_level level)
Set current log level.
odla_logging_func
void(* odla_logging_func)(const char *file_name, int line, const char *func_name, odla_log_level level, const char *msg)
Logging function type.
Definition:
odla_log.h:43
odla_log_level
odla_log_level
log level enum
Definition:
odla_log.h:32
Generated by
1.9.5