forked from jchambers/sort-by-log-size-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAILoggerPlugin.h
105 lines (80 loc) · 3.65 KB
/
AILoggerPlugin.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* Adium is the legal property of its developers, whose names are listed in the copyright file included
* with this source distribution.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define PATH_LOGS @"/Logs"
#define LOGGING_DEFAULT_PREFS @"LoggingDefaults"
#define PREF_GROUP_LOGGING @"Logging"
#define KEY_LOGGER_ENABLE @"Enable Logging"
#define PREF_KEYPATH_LOGGER_ENABLE PREF_GROUP_LOGGING @"." KEY_LOGGER_ENABLE
#define XML_LOGGING_NAMESPACE @"http://purl.org/net/ulf/ns/0.4-02"
@class AIAccount, AIHTMLDecoder, AIChat, AILoggerPreferences;
@interface AILoggerPlugin : AIPlugin {
AILoggerPreferences *preferences;
//Current logging settings
BOOL observingContent;
BOOL logHTML;
NSMutableDictionary *activeAppenders;
NSMutableDictionary *appenderCloseTimers;
AIHTMLDecoder *xhtmlDecoder;
NSDictionary *statusTranslation;
//Log viewer menu items
NSMenuItem *logViewerMenuItem;
NSMenuItem *viewContactLogsMenuItem;
NSMenuItem *viewContactLogsContextMenuItem;
NSMenuItem *viewGroupLogsContextMenuItem;
//Log content search index
BOOL logIndexingEnabled; //Does this system use log indexing?
SKIndexRef index_Content;
//Dirty all information (First build of the dirty cache)
BOOL stopIndexingThreads; //Set to YES to abort a dirty all or clean
BOOL suspendDirtyArraySave; //YES to prevent saving of the dirty index
BOOL isFlushingIndex;
NSLock *indexingThreadLock; //Locked by the plugin when a dirty all or clean thread is running
//Locked by the plugin while the index is being modified
NSConditionLock *logWritingLock;
//Locked by the plugin while the index is being closed
NSConditionLock *logClosingLock;
//Array of dirty logs / Logs that need re-indexing. (Locked access)
NSMutableArray *dirtyLogArray;
NSLock *dirtyLogLock;
//Indexing progress
NSInteger logsToIndex;
NSInteger logsIndexed;
NSInteger logIndexingPauses;
}
//Paths
+ (NSString *)logBasePath;
+ (NSString *)relativePathForLogWithObject:(NSString *)object onAccount:(AIAccount *)account;
//Message History
+ (NSArray *)sortedArrayOfLogFilesForChat:(AIChat *)chat;
//Log viewer
- (void)showLogViewerAndReindex:(id)sender;
- (void)showLogViewerToSelectedContact:(id)sender;
- (void)showLogViewerToSelectedContextContact:(id)sender;
//Log indexing
- (void)initLogIndexing;
- (void)prepareLogContentSearching;
- (void)cleanUpLogContentSearching;
- (SKIndexRef)logContentIndex;
- (void)markLogDirtyAtPath:(NSString *)path forChat:(AIChat *)chat;
- (void)markLogDirtyAtPath:(NSString *)path;
- (BOOL)getIndexingProgress:(NSUInteger *)complete outOf:(NSUInteger *)total;
- (void)stopIndexingThreads;
- (void)dirtyAllLogs;
- (void)cleanDirtyLogs;
- (void)pauseIndexing;
- (void)resumeIndexing;
- (void)removePathsFromIndex:(NSSet *)paths;
@end