<commit_before>//
//  RavenClient.h
//  Raven
//
//  Created by <NAME> on 25-05-12.
//  Copyright (c) 2012 Gangverk. All rights reserved.
//

#import <Foundation/Foundation.h>

#define RavenCaptureMessage( s, ... ) [[RavenClient sharedClient] captureMessage:[NSString stringWithFormat:(s), ##__VA_ARGS__] level:kRavenLogLevelDebugInfo method:__FUNCTION__ file:__FILE__ line:__LINE__]

#define RavenCaptureError(error) [[RavenClient sharedClient] captureMessage:[NSString stringWithFormat:@"%@", error] \
                                                                 level:kRavenLogLevelDebugError \
                                                       additionalExtra:@{@"Self" : [NSString stringWithFormat:@"%@ <%p>", NSStringFromClass(self.class), self], @"File" : [NSString stringWithUTF8String:__FILE__].lastPathComponent, @"Line" : [NSString stringWithFormat:@"%d", __LINE__], @"Function" : [NSString stringWithFormat:@"%s", __FUNCTION__]} \
                                                        additionalTags:nil]

#define RavenCaptureException(exception) [[RavenClient sharedClient] captureException:exception \
                                                                 additionalExtra:@{@"Self" : [NSString stringWithFormat:@"%@ <%p>", NSStringFromClass(self.class), self], @"File" : [[NSString stringWithUTF8String:__FILE__]lastPathComponent], @"Line" : [NSString stringWithFormat:@"%d", __LINE__], @"Function" : [NSString stringWithFormat:@"%s", __FUNCTION__]} \
                                                                  additionalTags:nil \
                                                                         sendNow:YES]


typedef enum {
    kRavenLogLevelDebug,
    kRavenLogLevelDebugInfo,
    kRavenLogLevelDebugWarning,
    kRavenLogLevelDebugError,
    kRavenLogLevelDebugFatal
} RavenLogLevel;


@interface RavenClient : NSObject <NSURLConnectionDelegate>

@property (strong, nonatomic) NSDictionary *extra;
@property (strong, nonatomic) NSDictionary *tags;

/**
 * By setting tags with setTags: selector it will also set default settings:
 * - Build version
 * - OS version (on iOS)
 * - Device model (on iOS)
 *
 * For full control use this method.
 */
- (void)setTags:(NSDictionary *)tags withDefaultValues:(BOOL)withDefaultValues;

// Singleton and initializers
+ (RavenClient *)clientWithDSN:(NSString *)DSN;
+ (RavenClient *)clientWithDSN:(NSString *)DSN extra:(NSDictionary *)extra;
+ (RavenClient *)clientWithDSN:(NSString *)DSN extra:(NSDictionary *)extra tags:(NSDictionary *)tags;
+ (RavenClient *)sharedClient;

- (id)initWithDSN:(NSString *)DSN;
- (id)initWithDSN:(NSString *)DSN extra:(NSDictionary *)extra;
- (id)initWithDSN:(NSString *)DSN extra:(NSDictionary *)extra tags:(NSDictionary *)tags;

/**
 * Messages
 *
 * All entries from additionalExtra/additionalTags are added to extra/tags.
 *
 * If dictionaries contain the same key, the entries from extra/tags dictionaries will be replaced with entries
 * from additionalExtra/additionalTags dictionaries.
 */
- (void)captureMessage:(NSString *)message;
- (void)captureMessage:(NSString *)message level:(RavenLogLevel)level;
- (void)captureMessage:(NSString *)message level:(RavenLogLevel)level method:(const char *)method file:(const char *)file line:(NSInteger)line;
- (void)captureMessage:(NSString *)message level:(RavenLogLevel)level additionalExtra:(NSDictionary *)additionalExtra additionalTags:(NSDictionary *)additionalTags;

- (void)captureMessage:(NSString *)message
                 level:(RavenLogLevel)level
       additionalExtra:(NSDictionary *)additionalExtra
        additionalTags:(NSDictionary *)additionalTags
                method:(const char *)method
                  file:(const char *)file
                  line:(NSInteger)line;

/**
 * Exceptions
 *
 * All entries from additionalExtra/additionalTags are added to extra/tags.
 *
 * If dictionaries contain the same key, the entries from extra/tags dictionaries will be replaced with entries
 * from additionalExtra/additionalTags dictionaries.
 */
- (void)captureException:(NSException *)exception;
- (void)captureException:(NSException *)exception sendNow:(BOOL)sendNow;
- (void)captureException:(NSException *)exception additionalExtra:(NSDictionary *)additionalExtra additionalTags:(NSDictionary *)additionalTags sendNow:(BOOL)sendNow;
- (void)setupExceptionHandler;

@end
<commit_msg>Used the overload of captureMessage that takes method, file and line.<commit_after>//
//  RavenClient.h
//  Raven
//
//  Created by <NAME> on 25-05-12.
//  Copyright (c) 2012 Gangverk. All rights reserved.
//

#import <Foundation/Foundation.h>

#define RavenCaptureMessage( s, ... ) [[RavenClient sharedClient] captureMessage:[NSString stringWithFormat:(s), ##__VA_ARGS__] level:kRavenLogLevelDebugInfo method:__FUNCTION__ file:__FILE__ line:__LINE__]

#define RavenCaptureError(error) [[RavenClient sharedClient] captureMessage:[NSString stringWithFormat:@"%@", error] \
                                                                      level:kRavenLogLevelDebugError \
                                                            additionalExtra:nil \
                                                             additionalTags:nil \
                                                                     method:__FUNCTION__ \
                                                                       file:__FILE__ \
                                                                       line:__LINE__];

#define RavenCaptureException(exception) [[RavenClient sharedClient] captureException:exception \
                                                                 additionalExtra:@{@"Self" : [NSString stringWithFormat:@"%@ <%p>", NSStringFromClass(self.class), self], @"File" : [[NSString stringWithUTF8String:__FILE__]lastPathComponent], @"Line" : [NSString stringWithFormat:@"%d", __LINE__], @"Function" : [NSString stringWithFormat:@"%s", __FUNCTION__]} \
                                                                  additionalTags:nil \
                                                                         sendNow:YES]


typedef enum {
    kRavenLogLevelDebug,
    kRavenLogLevelDebugInfo,
    kRavenLogLevelDebugWarning,
    kRavenLogLevelDebugError,
    kRavenLogLevelDebugFatal
} RavenLogLevel;


@interface RavenClient : NSObject <NSURLConnectionDelegate>

@property (strong, nonatomic) NSDictionary *extra;
@property (strong, nonatomic) NSDictionary *tags;

/**
 * By setting tags with setTags: selector it will also set default settings:
 * - Build version
 * - OS version (on iOS)
 * - Device model (on iOS)
 *
 * For full control use this method.
 */
- (void)setTags:(NSDictionary *)tags withDefaultValues:(BOOL)withDefaultValues;

// Singleton and initializers
+ (RavenClient *)clientWithDSN:(NSString *)DSN;
+ (RavenClient *)clientWithDSN:(NSString *)DSN extra:(NSDictionary *)extra;
+ (RavenClient *)clientWithDSN:(NSString *)DSN extra:(NSDictionary *)extra tags:(NSDictionary *)tags;
+ (RavenClient *)sharedClient;

- (id)initWithDSN:(NSString *)DSN;
- (id)initWithDSN:(NSString *)DSN extra:(NSDictionary *)extra;
- (id)initWithDSN:(NSString *)DSN extra:(NSDictionary *)extra tags:(NSDictionary *)tags;

/**
 * Messages
 *
 * All entries from additionalExtra/additionalTags are added to extra/tags.
 *
 * If dictionaries contain the same key, the entries from extra/tags dictionaries will be replaced with entries
 * from additionalExtra/additionalTags dictionaries.
 */
- (void)captureMessage:(NSString *)message;
- (void)captureMessage:(NSString *)message level:(RavenLogLevel)level;
- (void)captureMessage:(NSString *)message level:(RavenLogLevel)level method:(const char *)method file:(const char *)file line:(NSInteger)line;
- (void)captureMessage:(NSString *)message level:(RavenLogLevel)level additionalExtra:(NSDictionary *)additionalExtra additionalTags:(NSDictionary *)additionalTags;

- (void)captureMessage:(NSString *)message
                 level:(RavenLogLevel)level
       additionalExtra:(NSDictionary *)additionalExtra
        additionalTags:(NSDictionary *)additionalTags
                method:(const char *)method
                  file:(const char *)file
                  line:(NSInteger)line;

/**
 * Exceptions
 *
 * All entries from additionalExtra/additionalTags are added to extra/tags.
 *
 * If dictionaries contain the same key, the entries from extra/tags dictionaries will be replaced with entries
 * from additionalExtra/additionalTags dictionaries.
 */
- (void)captureException:(NSException *)exception;
- (void)captureException:(NSException *)exception sendNow:(BOOL)sendNow;
- (void)captureException:(NSException *)exception additionalExtra:(NSDictionary *)additionalExtra additionalTags:(NSDictionary *)additionalTags sendNow:(BOOL)sendNow;
- (void)setupExceptionHandler;

@end

{'fraction_non_alphanumeric': 0.11135024920706842, 'fraction_numerical': 0.0026053466243769825, 'mean_word_length': 3.2103004291845494, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1634506', 'n_tokens_mistral': 2411, 'n_tokens_neox': 2181, 'n_words': 537}