Blame view

HDFwear/3rd/RTKOTASDK/RTKLEFoundation.framework/Headers/RTKLog.h 1.62 KB
75d24c15   yangbin   123
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  //
  //  RTKLog.h
  //  RTKLEFoundation
  //
  //  Created by jerome_gu on 2019/1/21.
  //  Copyright © 2019 Realtek. All rights reserved.
  //
  
  #import <Foundation/Foundation.h>
  
  NS_ASSUME_NONNULL_BEGIN
  
  /*!
   * Represents available facility used for identity the log message destination.
   */
  typedef enum : NSUInteger {
      RTKLogFacilityDefault, /* Direct log to NSLog */
      RTKLogFacilityCocoaLumberjack  __attribute((availability(ios,unavailable))) __attribute((availability(macos,unavailable))), // Direct log to CocoaLumberjack. Not support
      RTKLogFacilityCustom,  // Direct log to a custom C function which is set by -setLogger: method.
  } RTKLogFacility;
  
  
  /**
   * Log level of the RTKLog facility.
   */
  typedef NS_ENUM(NSUInteger, RTKLogLevel) {
      RTKLogLevelOff       = 0,
      RTKLogLevelError,
      RTKLogLevelWarning,
      RTKLogLevelInfo,
      RTKLogLevelDebug,
      RTKLogLevelVerbose,
  };
  
  
  /**
   * RTKLog is a logging facility which used by Realtek SDKs.
   * @discussion Several API is public for control the log level and logging destination.
   */
  @interface RTKLog : NSObject
  
  /*!
   * Change the logging direction.
   * @discussion When set to RTKLogFacilityCustom, a custom logger C function should be set by call +setLogger: before.
   */
  + (void)setFacility:(RTKLogFacility)facility;
  
  /**
   * Pass a C function to receive the log message.
   */
  + (void)setLogger:(void(*)(NSString*))logFunc;
  
  /**
   * Set log level of this module
   * @see RTKLogLevel
   */
  + (void)setLogLevel:(RTKLogLevel)level;
  
  
  /**
   * Log method used internal. Don't use it directly.
   */
  + (void)_logWithLevel:(RTKLogLevel)level format:(NSString *)format, ...;
  
  @end
  
  NS_ASSUME_NONNULL_END