FPRGDTLogger.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "FirebasePerformance/Sources/Protogen/nanopb/perf_metric.nanopb.h"
  16. NS_ASSUME_NONNULL_BEGIN
  17. /** Logger used to dispatch events to Google Data Transport layer. */
  18. NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions.")
  19. @interface FPRGDTLogger : NSObject
  20. /** Log source initialized against. */
  21. @property(nonatomic, readonly) NSInteger logSource;
  22. /** Default initializer. */
  23. - (instancetype)init NS_UNAVAILABLE;
  24. /**
  25. * Instantiates an instance of this class.
  26. *
  27. * @param logSource The log source for this logger to be used.
  28. * @return Instance of FPRGDTLogger.
  29. */
  30. - (instancetype)initWithLogSource:(NSInteger)logSource NS_DESIGNATED_INITIALIZER;
  31. /**
  32. * Logs an event that needs to be dispatched.
  33. *
  34. * @remark Events are logged/dispatched asynchronously using a serial dispatch queue.
  35. * @param event The event to log.
  36. */
  37. - (void)logEvent:(firebase_perf_v1_PerfMetric)event;
  38. @end
  39. NS_ASSUME_NONNULL_END