FPRGDTLogger.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. @interface FPRGDTLogger : NSObject
  19. /** Log source initialized against. */
  20. @property(nonatomic, readonly) NSInteger logSource;
  21. /** Default initializer. */
  22. - (instancetype)init NS_UNAVAILABLE;
  23. /**
  24. * Instantiates an instance of this class.
  25. *
  26. * @param logSource The log source for this logger to be used.
  27. * @return Instance of FPRGDTLogger.
  28. */
  29. - (instancetype)initWithLogSource:(NSInteger)logSource NS_DESIGNATED_INITIALIZER;
  30. /**
  31. * Logs an event that needs to be dispatched.
  32. *
  33. * @remark Events are logged/dispatched asynchrounously using a serial dispatch queue.
  34. * @param event The event to log.
  35. */
  36. - (void)logEvent:(firebase_perf_v1_PerfMetric)event;
  37. @end
  38. NS_ASSUME_NONNULL_END