Files
firebase-ios-sdk/GoogleDataTransport/GDTCORLibrary/Public/GDTCORConsoleLogger.h
T

84 lines
3.0 KiB
Objective-C
Raw Normal View History

2019-04-12 19:27:00 -07:00
/*
* Copyright 2018 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
2019-04-12 19:27:00 -07:00
/** A list of message codes to print in the logger that help to correspond printed messages with
* code locations.
*
* Prefixes:
* - MCW => MessageCodeWarning
* - MCE => MessageCodeError
*/
2019-09-09 15:21:29 -07:00
typedef NS_ENUM(NSInteger, GDTCORMessageCode) {
2019-04-12 19:27:00 -07:00
/** For warning messages concerning transportBytes: not being implemented by a data object. */
2019-09-09 15:21:29 -07:00
GDTCORMCWDataObjectMissingBytesImpl = 1,
2019-04-12 19:27:00 -07:00
/** For warning messages concerning a failed event upload. */
2019-09-09 15:21:29 -07:00
GDTCORMCWUploadFailed = 2,
2019-04-12 19:27:00 -07:00
/** For warning messages concerning a forced event upload. */
2019-09-09 15:21:29 -07:00
GDTCORMCWForcedUpload = 3,
2019-04-12 19:27:00 -07:00
/** For warning messages concerning a failed reachability call. */
2019-09-09 15:21:29 -07:00
GDTCORMCWReachabilityFailed = 4,
2019-04-12 19:27:00 -07:00
/** For error messages concerning transform: not being implemented by an event transformer. */
2019-09-09 15:21:29 -07:00
GDTCORMCETransformerDoesntImplementTransform = 1000,
2019-04-12 19:27:00 -07:00
/** For error messages concerning the creation of a directory failing. */
2019-09-09 15:21:29 -07:00
GDTCORMCEDirectoryCreationError = 1001,
2019-04-12 19:27:00 -07:00
/** For error messages concerning the writing of a event file. */
2019-09-09 15:21:29 -07:00
GDTCORMCEFileWriteError = 1002,
/** For error messages concerning the lack of a prioritizer for a given backend. */
2019-09-09 15:21:29 -07:00
GDTCORMCEPrioritizerError = 1003,
/** For error messages concerning a package delivery API violation. */
2019-09-09 15:21:29 -07:00
GDTCORMCEDeliverTwice = 1004,
/** For error messages concerning an error in an implementation of -transportBytes. */
2019-09-09 15:21:29 -07:00
GDTCORMCETransportBytesError = 1005,
/** For general purpose error messages in a dependency. */
2019-09-09 15:21:29 -07:00
GDTCORMCEGeneralError = 1006,
/** For fatal errors. Please go to https://github.com/firebase/firebase-ios-sdk/issues and open
* an issue if you encounter an error with this code.
*/
2019-09-09 15:21:29 -07:00
GDTCORMCEFatalAssertion = 1007
2019-04-12 19:27:00 -07:00
};
/** */
FOUNDATION_EXPORT
2019-09-09 15:21:29 -07:00
void GDTCORLog(GDTCORMessageCode code, NSString *_Nonnull format, ...);
2019-04-12 19:27:00 -07:00
/** Returns the string that represents some message code.
*
* @param code The code to convert to a string.
* @return The string representing the message code.
*/
2019-09-09 15:21:29 -07:00
FOUNDATION_EXPORT NSString *_Nonnull GDTCORMessageCodeEnumToString(GDTCORMessageCode code);
2019-04-12 19:27:00 -07:00
// A define to wrap GULLogWarning with slightly more convenient usage.
2019-09-09 15:21:29 -07:00
#define GDTCORLogWarning(MESSAGE_CODE, MESSAGE_FORMAT, ...) \
GDTCORLog(MESSAGE_CODE, MESSAGE_FORMAT, __VA_ARGS__);
2019-04-12 19:27:00 -07:00
// A define to wrap GULLogError with slightly more convenient usage and a failing assert.
2019-09-09 15:21:29 -07:00
#define GDTCORLogError(MESSAGE_CODE, MESSAGE_FORMAT, ...) \
GDTCORLog(MESSAGE_CODE, MESSAGE_FORMAT, __VA_ARGS__);