GCKLogger.h
1 // Copyright 2013 Google Inc.
2 
3 #import <GoogleCast/GCKLoggerCommon.h>
4 
5 #import <GoogleCast/GCKDefines.h>
6 
7 #import <Foundation/Foundation.h>
8 
9 @protocol GCKLoggerDelegate;
10 @class GCKLoggerFilter;
11 
12 GCK_ASSUME_NONNULL_BEGIN
13 
21 GCK_EXPORT
22 @interface GCKLogger : NSObject
23 
25 @property(nonatomic, weak, readwrite, GCK_NULLABLE) id<GCKLoggerDelegate> delegate;
26 
32 @property(nonatomic, strong, readwrite, GCK_NULLABLE) GCKLoggerFilter *filter;
33 
39 @property(nonatomic, assign, readwrite) BOOL loggingEnabled;
40 
48 @property(nonatomic, assign, readwrite) BOOL fileLoggingEnabled;
49 
55 @property(nonatomic, assign, readwrite) BOOL consoleLoggingEnabled;
56 
63 @property(nonatomic, assign, readwrite) NSUInteger maxLogFileSize;
64 
70 @property(nonatomic, assign, readwrite) NSUInteger maxLogFileCount;
71 
78 @property(nonatomic, assign, readwrite) GCKLoggerLevel minimumLevel DEPRECATED_ATTRIBUTE;
79 
84 
85 @end
86 
90 GCK_EXPORT
91 @protocol GCKLoggerDelegate <NSObject>
92 
93 @optional
94 
105 - (void)logMessage:(NSString *)message
106  atLevel:(GCKLoggerLevel)level
107  fromFunction:(NSString *)function
108  location:(NSString *)location;
109 
118 - (void)logMessage:(NSString *)message fromFunction:(NSString *)function
119  GCK_DEPRECATED("Use -[GCKLoggerDelegate logMessage:atLevel:fromFunction:location:]");
120 
121 @end
122 
123 GCK_ASSUME_NONNULL_END
124 
129 #define GCKLog NSLog
GCKLoggerLevel minimumLevel DEPRECATED_ATTRIBUTE
The minimum logging level that will be logged.
Definition: GCKLogger.h:78
GCKLogger * sharedInstance()
Returns the GCKLogger singleton instance.
id< GCKLoggerDelegate > delegate
The delegate to pass log messages to.
Definition: GCKLogger.h:25
A class for filtering log messages that are produced using GCKLogger.
Definition: GCKLoggerFilter.h:16
BOOL loggingEnabled
Flag for enabling or disabling logging.
Definition: GCKLogger.h:39
A singleton object used for logging by the framework.
Definition: GCKLogger.h:22
BOOL fileLoggingEnabled
Flag for enabling or disabling file logging.
Definition: GCKLogger.h:48
NSUInteger maxLogFileCount
The maximum number of log files.
Definition: GCKLogger.h:70
GCKLoggerFilter * filter
The filter to apply to log messages.
Definition: GCKLogger.h:32
BOOL consoleLoggingEnabled
Flag for enabling or disabling logging directly to the console (via NSLog).
Definition: GCKLogger.h:55
NSUInteger maxLogFileSize
The maximum size of a log file, in bytes.
Definition: GCKLogger.h:63