Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase filter function #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@

# Created by https://www.gitignore.io/api/osx,xcode,swift

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/

# CocoaPods - Refactored to standalone file

# Carthage - Refactored to standalone file

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated

## Various settings

## Other

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno


# End of https://www.gitignore.io/api/osx,xcode,swift
30 changes: 24 additions & 6 deletions LogGuru.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
1F9612C31DB8938100DE647E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1F9612C21DB8938100DE647E /* Assets.xcassets */; };
1F9612C61DB8938100DE647E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1F9612C41DB8938100DE647E /* MainMenu.xib */; };
1F9612D11DB8938100DE647E /* LogGuruTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F9612D01DB8938100DE647E /* LogGuruTests.m */; };
1F9612DD1DB8946100DE647E /* MobileDevice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F9612DC1DB8946100DE647E /* MobileDevice.framework */; };
1F9612DE1DB8946100DE647E /* MobileDevice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F9612DC1DB8946100DE647E /* MobileDevice.framework */; };
1F9612E11DB8B04F00DE647E /* FIRUSBLoger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F9612E01DB8B04F00DE647E /* FIRUSBLoger.m */; };
1F9612E21DB8B04F00DE647E /* FIRUSBLoger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F9612E01DB8B04F00DE647E /* FIRUSBLoger.m */; };
1F9612E41DB8B13000DE647E /* AppIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1F9612E31DB8B13000DE647E /* AppIcon.icns */; };
32EDBF262060F2B2001E4E38 /* MobileDevice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32EDBF252060F2B2001E4E38 /* MobileDevice.framework */; };
32EDBF272060F2B2001E4E38 /* MobileDevice.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 32EDBF252060F2B2001E4E38 /* MobileDevice.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -29,6 +29,20 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
32EDBF282060F2B3001E4E38 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
32EDBF272060F2B2001E4E38 /* MobileDevice.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1F9612B91DB8938100DE647E /* LogGuru.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LogGuru.app; sourceTree = BUILT_PRODUCTS_DIR; };
1F9612BC1DB8938100DE647E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand All @@ -41,26 +55,25 @@
1F9612D01DB8938100DE647E /* LogGuruTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LogGuruTests.m; sourceTree = "<group>"; };
1F9612D21DB8938100DE647E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1F9612DB1DB8944C00DE647E /* MobileDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileDevice.h; sourceTree = "<group>"; };
1F9612DC1DB8946100DE647E /* MobileDevice.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileDevice.framework; path = ../../../../../System/Library/PrivateFrameworks/MobileDevice.framework; sourceTree = "<group>"; };
1F9612DF1DB8B04F00DE647E /* FIRUSBLoger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRUSBLoger.h; sourceTree = "<group>"; };
1F9612E01DB8B04F00DE647E /* FIRUSBLoger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRUSBLoger.m; sourceTree = "<group>"; };
1F9612E31DB8B13000DE647E /* AppIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon.icns; sourceTree = "<group>"; };
32EDBF252060F2B2001E4E38 /* MobileDevice.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MobileDevice.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
1F9612B61DB8938100DE647E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1F9612DD1DB8946100DE647E /* MobileDevice.framework in Frameworks */,
32EDBF262060F2B2001E4E38 /* MobileDevice.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1F9612C91DB8938100DE647E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1F9612DE1DB8946100DE647E /* MobileDevice.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -70,6 +83,7 @@
1F9612B01DB8938100DE647E = {
isa = PBXGroup;
children = (
32EDBF252060F2B2001E4E38 /* MobileDevice.framework */,
1F9612BB1DB8938100DE647E /* LogGuru */,
1F9612CF1DB8938100DE647E /* LogGuruTests */,
1F9612BA1DB8938100DE647E /* Products */,
Expand Down Expand Up @@ -104,7 +118,6 @@
1F9612C71DB8938100DE647E /* Info.plist */,
1F9612C41DB8938100DE647E /* MainMenu.xib */,
1F9612E31DB8B13000DE647E /* AppIcon.icns */,
1F9612DC1DB8946100DE647E /* MobileDevice.framework */,
1F9612DB1DB8944C00DE647E /* MobileDevice.h */,
1F9612C01DB8938100DE647E /* main.m */,
);
Expand All @@ -130,6 +143,7 @@
1F9612B51DB8938100DE647E /* Sources */,
1F9612B61DB8938100DE647E /* Frameworks */,
1F9612B71DB8938100DE647E /* Resources */,
32EDBF282060F2B3001E4E38 /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -345,6 +359,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = LogGuru/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
Expand All @@ -361,6 +376,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = LogGuru/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
Expand Down Expand Up @@ -425,6 +441,7 @@
1F9612D71DB8938100DE647E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1F9612D81DB8938100DE647E /* Build configuration list for PBXNativeTarget "LogGuruTests" */ = {
isa = XCConfigurationList;
Expand All @@ -433,6 +450,7 @@
1F9612DA1DB8938100DE647E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
2 changes: 1 addition & 1 deletion LogGuru/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

@interface AppDelegate : NSObject <NSApplicationDelegate,NSTokenFieldDelegate>


+ (void)logMsg:(NSDictionary *)logInfo;
@end

13 changes: 13 additions & 0 deletions LogGuru/AppDelegate.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ @interface AppDelegate ()<NSCollectionViewDelegate>
@property (weak) IBOutlet NSTextField *statView;
@property (unsafe_unretained) IBOutlet NSTextView *logView;
@property (weak) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSTextField *filterInfoLabel;

@property (strong) FIRUSBLoger *logger;

Expand Down Expand Up @@ -53,6 +54,11 @@ - (IBAction)pauseLog:(id)sender {
}


+ (void)logMsg:(NSDictionary *)logInfo {
if ([[NSApplication sharedApplication].delegate isKindOfClass:[AppDelegate class]]) {
[(AppDelegate *)[NSApplication sharedApplication].delegate logMsg:logInfo];
}
}

-(void)logMsg:(NSDictionary*)logInfo{
//printf("%s",[msg UTF8String]);
Expand All @@ -65,6 +71,13 @@ -(void)logMsg:(NSDictionary*)logInfo{
return;
}

if (logInfo.process
&& self.filterInfoLabel.stringValue
&& self.filterInfoLabel.stringValue.length > 0
&& [logInfo.log rangeOfString:self.filterInfoLabel.stringValue].length == 0) {
return;
}

if ([logInfo.process isEqualToString:@"syslog_relay"]) {
if ([logInfo.log rangeOfString:@"Start"].length>0 && self.logView.textStorage.layoutManagers) {
[self.logView.textStorage appendAttributedString:
Expand Down
31 changes: 23 additions & 8 deletions LogGuru/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="16A323" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand All @@ -14,6 +15,7 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate">
<connections>
<outlet property="filterInfoLabel" destination="Ur5-6Y-BDf" id="oB9-Oz-uiN"/>
<outlet property="logView" destination="gOg-YT-kSR" id="1UU-zK-Zx5"/>
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
</connections>
Expand Down Expand Up @@ -497,18 +499,16 @@
<rect key="frame" x="-1" y="-1" width="811" height="513"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Srs-La-U9Q">
<rect key="frame" x="1" y="1" width="223" height="133"/>
<rect key="frame" x="1" y="1" width="809" height="511"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" selectionGranularity="paragraph" findStyle="panel" allowsUndo="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" smartInsertDelete="YES" id="gOg-YT-kSR">
<textView editable="NO" importsGraphics="NO" selectionGranularity="paragraph" findStyle="panel" allowsUndo="YES" allowsNonContiguousLayout="YES" smartInsertDelete="YES" id="gOg-YT-kSR">
<rect key="frame" x="0.0" y="0.0" width="809" height="511"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="223" height="511"/>
<size key="minSize" width="809" height="511"/>
<size key="maxSize" width="811" height="10000000"/>
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="223" height="511"/>
<size key="maxSize" width="811" height="10000000"/>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -538,6 +538,20 @@
<action selector="cleanLog:" target="Voe-Tx-rLC" id="4rC-iv-mLb"/>
</connections>
</toolbarItem>
<toolbarItem implicitItemIdentifier="45C5F44C-D764-455D-A5B7-E1821AFD2E7C" label="Filter" paletteLabel="Filter" id="F3J-N4-M4b" userLabel="Filter">
<nil key="toolTip"/>
<size key="minSize" width="96" height="22"/>
<size key="maxSize" width="96" height="22"/>
<textField key="view" verticalHuggingPriority="750" id="Ur5-6Y-BDf">
<rect key="frame" x="0.0" y="14" width="96" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="CGT-wA-Scl">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</toolbarItem>
<toolbarItem implicitItemIdentifier="5F9D1607-2B48-4BE5-AB66-9E49E30D18C1" label="fir.im" paletteLabel="fir.im" tag="-1" image="NSInfo" id="t2O-NE-IEI">
<connections>
<action selector="openAbout:" target="Voe-Tx-rLC" id="T24-iB-NQG"/>
Expand All @@ -548,6 +562,7 @@
<toolbarItem reference="8bk-Ou-n3l"/>
<toolbarItem reference="4Yn-Cb-fKG"/>
<toolbarItem reference="rXq-2N-sJa"/>
<toolbarItem reference="F3J-N4-M4b"/>
<toolbarItem reference="t2O-NE-IEI"/>
</defaultToolbarItems>
</toolbar>
Expand All @@ -557,7 +572,7 @@
</objects>
<resources>
<image name="NSInfo" width="32" height="32"/>
<image name="NSPauseTemplate" width="128" height="128"/>
<image name="NSPauseTemplate" width="8" height="9"/>
<image name="NSTrashEmpty" width="32" height="32"/>
</resources>
</document>
4 changes: 2 additions & 2 deletions LogGuru/FIRUSBLoger.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "FIRUSBLoger.h"
#import "AppDelegate.h"
#import "MobileDevice.h"
#import <AppKit/AppKit.h>

Expand Down Expand Up @@ -67,8 +68,7 @@ static void SocketCallback(CFSocketRef s, CFSocketCallBackType type, CFDataRef a
};



[[NSNotificationCenter defaultCenter] postNotificationName:@"DeviceLog" object:nil userInfo:info];
[AppDelegate logMsg:info];
}

}
Expand Down
1 change: 1 addition & 0 deletions MobileDevice.framework/MobileDevice
1 change: 1 addition & 0 deletions MobileDevice.framework/Resources
Loading