Guardtime KSI c SDK
log.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-2015 Guardtime, Inc.
3  *
4  * This file is part of the Guardtime client SDK.
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  * http://www.apache.org/licenses/LICENSE-2.0
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
13  * express or implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  * "Guardtime" and "KSI" are trademarks or registered trademarks of
16  * Guardtime, Inc., and no license to trademarks is granted; Guardtime
17  * reserves and retains all trademark rights.
18  */
19 
20 #ifndef KSI_LOG_H_
21 #define KSI_LOG_H_
22 
23 #include "common.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
40  KSI_LOG_NONE = 0x00,
41 
43  KSI_LOG_ERROR = 0x01,
44 
46  KSI_LOG_WARN = 0x02,
47 
50 
52  KSI_LOG_INFO = 0x04,
53 
55  KSI_LOG_DEBUG = 0x05,
56  };
57 
65  int KSI_LOG_debug(KSI_CTX *ctx, char *format, ...);
66 
74  int KSI_LOG_info(KSI_CTX *ctx, char *format, ...);
75 
83  int KSI_LOG_notice(KSI_CTX *ctx, char *format, ...);
84 
92  int KSI_LOG_warn(KSI_CTX *ctx, char *format, ...);
93 
101  int KSI_LOG_error(KSI_CTX *ctx, char *format, ...);
102 
113  int KSI_LOG_logBlob(KSI_CTX *ctx, int level, const char *prefix, const unsigned char *data, size_t data_len);
114 
125  int KSI_LOG_logTlv(KSI_CTX *ctx, int level, const char *prefix, const KSI_TLV *tlv);
126 
137  int KSI_LOG_logDataHash(KSI_CTX *ctx, int level, const char *prefix, const KSI_DataHash *hsh);
138 
146  int KSI_LOG_logCtxError(KSI_CTX *ctx, int level);
147 
157  int KSI_LOG_StreamLogger(void *logCtx, int logLevel, const char *message);
158 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif /* KSI_LOG_H_ */
int KSI_LOG_logTlv(KSI_CTX *ctx, int level, const char *prefix, const KSI_TLV *tlv)
Definition: log.h:55
int KSI_LOG_logDataHash(KSI_CTX *ctx, int level, const char *prefix, const KSI_DataHash *hsh)
int KSI_LOG_error(KSI_CTX *ctx, char *format,...)
KSI_LOG_LVL_en
Definition: log.h:38
int KSI_LOG_debug(KSI_CTX *ctx, char *format,...)
int KSI_LOG_StreamLogger(void *logCtx, int logLevel, const char *message)
int KSI_LOG_logBlob(KSI_CTX *ctx, int level, const char *prefix, const unsigned char *data, size_t data_len)
struct KSI_DataHash_st KSI_DataHash
Definition: hash.h:50
int KSI_LOG_notice(KSI_CTX *ctx, char *format,...)
int KSI_LOG_warn(KSI_CTX *ctx, char *format,...)
int KSI_LOG_info(KSI_CTX *ctx, char *format,...)
Definition: log.h:52
Definition: log.h:49
Definition: log.h:43
Definition: log.h:40
struct KSI_CTX_st KSI_CTX
Definition: types_base.h:124
struct KSI_TLV_st KSI_TLV
Definition: types_base.h:129
Definition: log.h:46
int KSI_LOG_logCtxError(KSI_CTX *ctx, int level)