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 #include "types.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
41  KSI_LOG_NONE = 0x00,
42 
44  KSI_LOG_ERROR = 0x01,
45 
47  KSI_LOG_WARN = 0x02,
48 
51 
53  KSI_LOG_INFO = 0x04,
54 
56  KSI_LOG_DEBUG = 0x05,
57  };
58 
66  int KSI_LOG_debug(KSI_CTX *ctx, char *format, ...) KSI_ATTRIBUTE((format(printf, 2, 3)));
67 
75  int KSI_LOG_info(KSI_CTX *ctx, char *format, ...) KSI_ATTRIBUTE((format(printf, 2, 3)));
76 
84  int KSI_LOG_notice(KSI_CTX *ctx, char *format, ...) KSI_ATTRIBUTE((format(printf, 2, 3)));
85 
93  int KSI_LOG_warn(KSI_CTX *ctx, char *format, ...) KSI_ATTRIBUTE((format(printf, 2, 3)));
94 
102  int KSI_LOG_error(KSI_CTX *ctx, char *format, ...) KSI_ATTRIBUTE((format(printf, 2, 3)));
103 
115  int KSI_LOG_logBlob(KSI_CTX *ctx, int level, const char *prefix_format, const unsigned char *data, size_t data_len, ...) KSI_ATTRIBUTE((format(printf, 3, 6)));
116 
127  int KSI_LOG_logTlv(KSI_CTX *ctx, int level, const char *prefix, const KSI_TLV *tlv);
128 
129 
140  int KSI_LOG_logDataHash(KSI_CTX *ctx, int level, const char *prefix, const KSI_DataHash *hsh);
141 
149  int KSI_LOG_logCtxError(KSI_CTX *ctx, int level);
150 
160  int KSI_LOG_StreamLogger(void *logCtx, int logLevel, const char *message);
161 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif /* KSI_LOG_H_ */
Definition: log.h:56
int KSI_LOG_logDataHash(KSI_CTX *ctx, int level, const char *prefix, const KSI_DataHash *hsh)
int int int int int KSI_LOG_error(KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf
KSI_LOG_LVL_en
Definition: log.h:39
#define KSI_ATTRIBUTE(x)
Definition: common.h:28
int int int int int int int KSI_LOG_logTlv(KSI_CTX *ctx, int level, const char *prefix, const KSI_TLV *tlv)
int int int KSI_LOG_notice(KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf
int int int int KSI_LOG_warn(KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf
int KSI_LOG_StreamLogger(void *logCtx, int logLevel, const char *message)
struct KSI_DataHash_st KSI_DataHash
Definition: hash.h:52
int KSI_LOG_debug(KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf
int int KSI_LOG_info(KSI_CTX *ctx, char *format,...) KSI_ATTRIBUTE((format(printf
Definition: log.h:53
Definition: log.h:50
Definition: log.h:44
Definition: log.h:41
struct KSI_CTX_st KSI_CTX
Definition: types_base.h:124
struct KSI_TLV_st KSI_TLV
Definition: types_base.h:129
int int int int int int KSI_LOG_logBlob(KSI_CTX *ctx, int level, const char *prefix_format, const unsigned char *data, size_t data_len,...) KSI_ATTRIBUTE((format(printf
Definition: log.h:47
int KSI_LOG_logCtxError(KSI_CTX *ctx, int level)