MBXLogConfiguration.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. #import <MapboxCommon/MBXLoggingLevel.h>
  4. @protocol MBXLogWriterBackend;
  5. /** Class that allows to configure Mapbox SDKs logging per application. */
  6. NS_SWIFT_NAME(LogConfiguration)
  7. __attribute__((visibility ("default")))
  8. @interface MBXLogConfiguration : NSObject
  9. // This class provides custom init which should be called
  10. - (nonnull instancetype)init NS_UNAVAILABLE;
  11. // This class provides custom init which should be called
  12. + (nonnull instancetype)new NS_UNAVAILABLE;
  13. /**
  14. * Sets the backend which writes the log.
  15. *
  16. * @param logWriter Backend which writes logs, if you provide null for this parameter then previously
  17. * used logger backend will be replaced with Mapbox default implementation.
  18. */
  19. + (void)registerLogWriterBackendForLogWriter:(nullable id<MBXLogWriterBackend>)logWriter;
  20. /**
  21. * Sets the default logging level.
  22. *
  23. * The logging level for a specific category can be overridden
  24. * using the setLoggingLevel(category, upTo) overload.
  25. *
  26. * @param upTo Log messages with lower severity than this parameter will be filtered out. If
  27. * the parameter is empty, all log messages are filtered out, i.e., logging is disabled.
  28. */
  29. + (void)setLoggingLevelForUpTo:(nullable NSNumber *)upTo;
  30. /**
  31. * Return current default logging level.
  32. *
  33. * @return Current default logging level or nothing if logging is disabled.
  34. */
  35. + (nullable NSNumber *)getLoggingLevel __attribute((ns_returns_retained));
  36. /**
  37. * Sets the logging level for provided category.
  38. *
  39. * @param category Category that should be used for applied configuration.
  40. * @param upTo Log messages for provided category and with lower severity than
  41. * this parameter will be filtered out. If the parameter is empty,
  42. * all log messages are filtered out, i.e., logging is disabled.
  43. */
  44. + (void)setLoggingLevelForCategory:(nonnull NSString *)category
  45. upTo:(nullable NSNumber *)upTo;
  46. /**
  47. * Return current logging level for category.
  48. *
  49. * @param category Category that can be used for filtering.
  50. * @return Configured logging level for category, or nothing if logging category is disabled.
  51. */
  52. + (nullable NSNumber *)getLoggingLevelForCategory:(nonnull NSString *)category __attribute((ns_returns_retained));
  53. /**
  54. * Reset logging level for category to default logging level.
  55. *
  56. * @param category Category that can be used for filtering.
  57. */
  58. + (void)resetLoggingLevelForCategory:(nonnull NSString *)category;
  59. @end