Proyectos de Subversion Iphone Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/*
2
 * Copyright 2017 Google
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
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 OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
 
17
#import "FirebaseMessaging/Sources/FIRMessagingCode.h"
18
 
19
// The convenience macros are only defined if they haven't already been defined.
20
#ifndef FIRMessagingLoggerInfo
21
 
22
// Convenience macros that log to the shared FIRMessagingLogger instance. These macros
23
// are how users should typically log to FIRMessagingLogger.
24
#define FIRMessagingLoggerDebug(code, ...) \
25
  [FIRMessagingSharedLogger() logFuncDebug:__func__ messageCode:code msg:__VA_ARGS__]
26
#define FIRMessagingLoggerInfo(code, ...) \
27
  [FIRMessagingSharedLogger() logFuncInfo:__func__ messageCode:code msg:__VA_ARGS__]
28
#define FIRMessagingLoggerNotice(code, ...) \
29
  [FIRMessagingSharedLogger() logFuncNotice:__func__ messageCode:code msg:__VA_ARGS__]
30
#define FIRMessagingLoggerWarn(code, ...) \
31
  [FIRMessagingSharedLogger() logFuncWarning:__func__ messageCode:code msg:__VA_ARGS__]
32
#define FIRMessagingLoggerError(code, ...) \
33
  [FIRMessagingSharedLogger() logFuncError:__func__ messageCode:code msg:__VA_ARGS__]
34
 
35
#endif  // !defined(FIRMessagingLoggerInfo)
36
 
37
@interface FIRMessagingLogger : NSObject
38
 
39
- (void)logFuncDebug:(const char *)func
40
         messageCode:(FIRMessagingMessageCode)messageCode
41
                 msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
42
 
43
- (void)logFuncInfo:(const char *)func
44
        messageCode:(FIRMessagingMessageCode)messageCode
45
                msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
46
 
47
- (void)logFuncNotice:(const char *)func
48
          messageCode:(FIRMessagingMessageCode)messageCode
49
                  msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
50
 
51
- (void)logFuncWarning:(const char *)func
52
           messageCode:(FIRMessagingMessageCode)messageCode
53
                   msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
54
 
55
- (void)logFuncError:(const char *)func
56
         messageCode:(FIRMessagingMessageCode)messageCode
57
                 msg:(NSString *)fmt, ... NS_FORMAT_FUNCTION(3, 4);
58
 
59
@end
60
 
61
/**
62
 * Instantiates and/or returns a shared FIRMessagingLogger used exclusively
63
 * for FIRMessaging log messages.
64
 *
65
 * @return the shared FIRMessagingLogger instance
66
 */
67
FIRMessagingLogger *FIRMessagingSharedLogger(void);