forked from Hammerspoon/hammerspoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHSLogger.h
35 lines (28 loc) · 912 Bytes
/
HSLogger.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// HSLogger.h
// Hammerspoon
//
// Created by Chris Jones on 22/01/2018.
// Copyright © 2018 Hammerspoon. All rights reserved.
//
#import <LuaSkin/LuaSkin.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wvariadic-macros"
#import "Sentry.h"
#pragma clang diagnostic pop
#import "secrets.h"
#ifdef SENTRY_API_URL
# define HSNSLOG(__FORMAT__, ...) [LuaSkin logBreadcrumb:[NSString stringWithFormat:__FORMAT__, ##__VA_ARGS__]];
#else
# define HSNSLOG(__FORMAT__, ...) NSLog(__FORMAT__, ##__VA_ARGS__)
#endif
@interface HSLogger : NSObject <LuaSkinDelegate> {
lua_State *_L;
}
@property (atomic, readonly) lua_State *L;
- (instancetype)initWithLua:(lua_State *)L;
- (void)setLuaState:(lua_State *)L;
- (void) logForLuaSkinAtLevel:(int)level withMessage:(NSString *)theMessage;
- (void)logBreadcrumb:(NSString *)format, ...;
- (void)logKnownBug:(NSString *)format, ...;
@end