motion-logger 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/README.md +3 -1
- data/Rakefile +2 -4
- data/lib/logger/version.rb +1 -1
- data/motion-logger.gemspec +3 -3
- metadata +28 -51
- data/vendor/Podfile.lock +0 -5
- data/vendor/Pods/CocoaLumberjack/.gitignore +0 -24
- data/vendor/Pods/CocoaLumberjack/.hgignore +0 -6
- data/vendor/Pods/CocoaLumberjack/CocoaLumberjack.podspec +0 -18
- data/vendor/Pods/CocoaLumberjack/LICENSE.txt +0 -18
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +0 -99
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +0 -618
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +0 -334
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +0 -1346
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +0 -498
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +0 -979
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +0 -49
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +0 -186
- data/vendor/Pods/CocoaLumberjack/README.markdown +0 -37
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +0 -334
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +0 -498
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +0 -49
- data/vendor/Pods/Pods-Acknowledgements.markdown +0 -24
- data/vendor/Pods/Pods-Acknowledgements.plist +0 -54
- data/vendor/Pods/Pods-prefix.pch +0 -3
- data/vendor/Pods/Pods-resources.sh +0 -19
- data/vendor/Pods/Pods.bridgesupport +0 -462
- data/vendor/Pods/Pods.xcconfig +0 -4
- data/vendor/Pods/PodsDummy_Pods.m +0 -4
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 96e90f37c5c828592f7af7fef66e10fcc5cf88d2
|
4
|
+
data.tar.gz: a6e9c8c70637123304d996fc4e9abf7f65c0758f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0f32f54a1ad9dd8c2e5111971679f647f6fee81b47b77f8b956515dfe3ccc4ee52515838c1e3f7ba345d9888516198087db0e7225507cc86ce8a2d7483bad34a
|
7
|
+
data.tar.gz: 866166f8906d259b8fb44856c04bfed08052aeaafa0e8906c565d92f16067ed1680f1c80ad4f95beb7ec04c251663b0be45f4f43206665af57ff1b1b9b4a7d58
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -7,6 +7,8 @@ Status: Basic features working
|
|
7
7
|
## Usage
|
8
8
|
|
9
9
|
```ruby
|
10
|
+
Log = Motion::Log
|
11
|
+
|
10
12
|
file_logger = DDFileLogger.new
|
11
13
|
file_logger.rollingFrequency = 60 * 60 * 24
|
12
14
|
file_logger.logFileManager.maximumNumberOfLogFiles = 1
|
@@ -57,4 +59,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
57
59
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
58
60
|
|
59
61
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
60
|
-
```
|
62
|
+
```
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
$:.unshift("/Library/RubyMotion/lib")
|
3
|
-
require 'motion/project'
|
3
|
+
require 'motion/project/template/ios'
|
4
4
|
require 'rubygems'
|
5
5
|
require 'motion-cocoapods'
|
6
6
|
require 'motion-redgreen'
|
@@ -10,12 +10,10 @@ Motion::Project::App.setup do |app|
|
|
10
10
|
app.name = 'logger'
|
11
11
|
|
12
12
|
app.pods do
|
13
|
-
pod 'CocoaLumberjack'
|
13
|
+
pod 'CocoaLumberjack', '~> 1.9.0'
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
17
|
desc "Build the gem"
|
20
18
|
task :gem do
|
21
19
|
sh "bundle exec gem build motion-logger.gemspec"
|
data/lib/logger/version.rb
CHANGED
data/motion-logger.gemspec
CHANGED
@@ -8,12 +8,12 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.summary = "A thin wrapper of CocoaLumberjack for RubyMotion."
|
9
9
|
gem.homepage = "https://github.com/siuying/motion-logger"
|
10
10
|
|
11
|
-
gem.files = `git ls-files`.split($\)
|
11
|
+
gem.files = `git ls-files | grep -v 'vendor'`.split($\)
|
12
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
13
|
gem.name = "motion-logger"
|
14
14
|
gem.require_paths = ["lib"]
|
15
15
|
gem.version = Motion::Logger::VERSION
|
16
16
|
|
17
|
-
gem.add_dependency 'motion-cocoapods', '
|
18
|
-
gem.add_development_dependency 'motion-redgreen'
|
17
|
+
gem.add_dependency 'motion-cocoapods', '~> 1.7', '>= 1.7.0'
|
18
|
+
gem.add_development_dependency 'motion-redgreen', '~> 1.0.0', '>= 1.0.0'
|
19
19
|
end
|
metadata
CHANGED
@@ -1,48 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Francis Chong
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-07-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: motion-cocoapods
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
19
|
+
version: '1.7'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.7.0
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.7'
|
30
|
+
- - ">="
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
32
|
+
version: 1.7.0
|
30
33
|
- !ruby/object:Gem::Dependency
|
31
34
|
name: motion-redgreen
|
32
35
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
36
|
requirements:
|
35
|
-
- -
|
37
|
+
- - "~>"
|
36
38
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
39
|
+
version: 1.0.0
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.0.0
|
38
43
|
type: :development
|
39
44
|
prerelease: false
|
40
45
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
46
|
requirements:
|
43
|
-
- -
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.0.0
|
50
|
+
- - ">="
|
44
51
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
52
|
+
version: 1.0.0
|
46
53
|
description: A thin wrapper of CocoaLumberjack for RubyMotion.
|
47
54
|
email:
|
48
55
|
- francis@ignition.hk
|
@@ -50,7 +57,7 @@ executables: []
|
|
50
57
|
extensions: []
|
51
58
|
extra_rdoc_files: []
|
52
59
|
files:
|
53
|
-
- .gitignore
|
60
|
+
- ".gitignore"
|
54
61
|
- Gemfile
|
55
62
|
- README.md
|
56
63
|
- Rakefile
|
@@ -60,58 +67,28 @@ files:
|
|
60
67
|
- lib/motion-logger.rb
|
61
68
|
- motion-logger.gemspec
|
62
69
|
- spec/log_spec.rb
|
63
|
-
- vendor/Podfile.lock
|
64
|
-
- vendor/Pods/CocoaLumberjack/.gitignore
|
65
|
-
- vendor/Pods/CocoaLumberjack/.hgignore
|
66
|
-
- vendor/Pods/CocoaLumberjack/CocoaLumberjack.podspec
|
67
|
-
- vendor/Pods/CocoaLumberjack/LICENSE.txt
|
68
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h
|
69
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m
|
70
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h
|
71
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m
|
72
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h
|
73
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m
|
74
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h
|
75
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m
|
76
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h
|
77
|
-
- vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m
|
78
|
-
- vendor/Pods/CocoaLumberjack/README.markdown
|
79
|
-
- vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h
|
80
|
-
- vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h
|
81
|
-
- vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h
|
82
|
-
- vendor/Pods/Headers/CocoaLumberjack/DDLog.h
|
83
|
-
- vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h
|
84
|
-
- vendor/Pods/Pods-Acknowledgements.markdown
|
85
|
-
- vendor/Pods/Pods-Acknowledgements.plist
|
86
|
-
- vendor/Pods/Pods-prefix.pch
|
87
|
-
- vendor/Pods/Pods-resources.sh
|
88
|
-
- vendor/Pods/Pods.bridgesupport
|
89
|
-
- vendor/Pods/Pods.xcconfig
|
90
|
-
- vendor/Pods/PodsDummy_Pods.m
|
91
|
-
- vendor/Pods/build-iPhoneSimulator/libPods.a
|
92
70
|
homepage: https://github.com/siuying/motion-logger
|
93
71
|
licenses: []
|
72
|
+
metadata: {}
|
94
73
|
post_install_message:
|
95
74
|
rdoc_options: []
|
96
75
|
require_paths:
|
97
76
|
- lib
|
98
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
78
|
requirements:
|
101
|
-
- -
|
79
|
+
- - ">="
|
102
80
|
- !ruby/object:Gem::Version
|
103
81
|
version: '0'
|
104
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
83
|
requirements:
|
107
|
-
- -
|
84
|
+
- - ">="
|
108
85
|
- !ruby/object:Gem::Version
|
109
86
|
version: '0'
|
110
87
|
requirements: []
|
111
88
|
rubyforge_project:
|
112
|
-
rubygems_version:
|
89
|
+
rubygems_version: 2.4.8
|
113
90
|
signing_key:
|
114
|
-
specification_version:
|
91
|
+
specification_version: 4
|
115
92
|
summary: A thin wrapper of CocoaLumberjack for RubyMotion.
|
116
93
|
test_files:
|
117
94
|
- spec/log_spec.rb
|
data/vendor/Podfile.lock
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# Xcode
|
2
|
-
build/*
|
3
|
-
*.pbxuser
|
4
|
-
!default.pbxuser
|
5
|
-
*.mode1v3
|
6
|
-
!default.mode1v3
|
7
|
-
*.mode2v3
|
8
|
-
!default.mode2v3
|
9
|
-
*.perspectivev3
|
10
|
-
!default.perspectivev3
|
11
|
-
*.xcworkspace
|
12
|
-
!default.xcworkspace
|
13
|
-
xcuserdata
|
14
|
-
profile
|
15
|
-
*.moved-aside
|
16
|
-
.DS_Store?
|
17
|
-
Icon?
|
18
|
-
|
19
|
-
# Thumbnails
|
20
|
-
._*
|
21
|
-
|
22
|
-
# Files that might appear on external disk
|
23
|
-
.Spotlight-V100
|
24
|
-
.Trashes
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Pod::Spec.new do |s|
|
2
|
-
s.name = 'CocoaLumberjack'
|
3
|
-
s.version = '1.3.1'
|
4
|
-
s.license = 'BSD'
|
5
|
-
s.summary = 'A fast & simple, yet powerful & flexible logging framework for Mac and iOS.'
|
6
|
-
s.homepage = 'https://github.com/robbiehanson/CocoaLumberjack'
|
7
|
-
s.author = { 'Robbie Hanson' => 'robbiehanson@deusty.com' }
|
8
|
-
s.source = { :git => 'https://github.com/robbiehanson/CocoaLumberjack.git',
|
9
|
-
:tag => '1.3.1' }
|
10
|
-
|
11
|
-
s.description = 'It is similar in concept to other popular logging frameworks such as log4j, ' \
|
12
|
-
'yet is designed specifically for objective-c, and takes advantage of features ' \
|
13
|
-
'such as multi-threading, grand central dispatch (if available), lockless ' \
|
14
|
-
'atomic operations, and the dynamic nature of the objective-c runtime.'
|
15
|
-
|
16
|
-
s.source_files = 'Lumberjack'
|
17
|
-
s.clean_paths = 'Benchmarking', 'Xcode'
|
18
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Software License Agreement (BSD License)
|
2
|
-
|
3
|
-
Copyright (c) 2010, Deusty, LLC
|
4
|
-
All rights reserved.
|
5
|
-
|
6
|
-
Redistribution and use of this software in source and binary forms,
|
7
|
-
with or without modification, are permitted provided that the following conditions are met:
|
8
|
-
|
9
|
-
* Redistributions of source code must retain the above
|
10
|
-
copyright notice, this list of conditions and the
|
11
|
-
following disclaimer.
|
12
|
-
|
13
|
-
* Neither the name of Deusty nor the names of its
|
14
|
-
contributors may be used to endorse or promote products
|
15
|
-
derived from this software without specific prior
|
16
|
-
written permission of Deusty, LLC.
|
17
|
-
|
18
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,41 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import <asl.h>
|
3
|
-
|
4
|
-
#import "DDLog.h"
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Welcome to Cocoa Lumberjack!
|
8
|
-
*
|
9
|
-
* The project page has a wealth of documentation if you have any questions.
|
10
|
-
* https://github.com/robbiehanson/CocoaLumberjack
|
11
|
-
*
|
12
|
-
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
13
|
-
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
14
|
-
*
|
15
|
-
*
|
16
|
-
* This class provides a logger for the Apple System Log facility.
|
17
|
-
*
|
18
|
-
* As described in the "Getting Started" page,
|
19
|
-
* the traditional NSLog() function directs it's output to two places:
|
20
|
-
*
|
21
|
-
* - Apple System Log
|
22
|
-
* - StdErr (if stderr is a TTY) so log statements show up in Xcode console
|
23
|
-
*
|
24
|
-
* To duplicate NSLog() functionality you can simply add this logger and a tty logger.
|
25
|
-
* However, if you instead choose to use file logging (for faster performance),
|
26
|
-
* you may choose to use a file logger and a tty logger.
|
27
|
-
**/
|
28
|
-
|
29
|
-
@interface DDASLLogger : DDAbstractLogger <DDLogger>
|
30
|
-
{
|
31
|
-
aslclient client;
|
32
|
-
}
|
33
|
-
|
34
|
-
+ (DDASLLogger *)sharedInstance;
|
35
|
-
|
36
|
-
// Inherited from DDAbstractLogger
|
37
|
-
|
38
|
-
// - (id <DDLogFormatter>)logFormatter;
|
39
|
-
// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
40
|
-
|
41
|
-
@end
|
@@ -1,99 +0,0 @@
|
|
1
|
-
#import "DDASLLogger.h"
|
2
|
-
|
3
|
-
#import <libkern/OSAtomic.h>
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Welcome to Cocoa Lumberjack!
|
7
|
-
*
|
8
|
-
* The project page has a wealth of documentation if you have any questions.
|
9
|
-
* https://github.com/robbiehanson/CocoaLumberjack
|
10
|
-
*
|
11
|
-
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
12
|
-
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
13
|
-
**/
|
14
|
-
|
15
|
-
#if ! __has_feature(objc_arc)
|
16
|
-
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
17
|
-
#endif
|
18
|
-
|
19
|
-
|
20
|
-
@implementation DDASLLogger
|
21
|
-
|
22
|
-
static DDASLLogger *sharedInstance;
|
23
|
-
|
24
|
-
/**
|
25
|
-
* The runtime sends initialize to each class in a program exactly one time just before the class,
|
26
|
-
* or any class that inherits from it, is sent its first message from within the program. (Thus the
|
27
|
-
* method may never be invoked if the class is not used.) The runtime sends the initialize message to
|
28
|
-
* classes in a thread-safe manner. Superclasses receive this message before their subclasses.
|
29
|
-
*
|
30
|
-
* This method may also be called directly (assumably by accident), hence the safety mechanism.
|
31
|
-
**/
|
32
|
-
+ (void)initialize
|
33
|
-
{
|
34
|
-
static BOOL initialized = NO;
|
35
|
-
if (!initialized)
|
36
|
-
{
|
37
|
-
initialized = YES;
|
38
|
-
|
39
|
-
sharedInstance = [[DDASLLogger alloc] init];
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
+ (DDASLLogger *)sharedInstance
|
44
|
-
{
|
45
|
-
return sharedInstance;
|
46
|
-
}
|
47
|
-
|
48
|
-
- (id)init
|
49
|
-
{
|
50
|
-
if (sharedInstance != nil)
|
51
|
-
{
|
52
|
-
return nil;
|
53
|
-
}
|
54
|
-
|
55
|
-
if ((self = [super init]))
|
56
|
-
{
|
57
|
-
// A default asl client is provided for the main thread,
|
58
|
-
// but background threads need to create their own client.
|
59
|
-
|
60
|
-
client = asl_open(NULL, "com.apple.console", 0);
|
61
|
-
}
|
62
|
-
return self;
|
63
|
-
}
|
64
|
-
|
65
|
-
- (void)logMessage:(DDLogMessage *)logMessage
|
66
|
-
{
|
67
|
-
NSString *logMsg = logMessage->logMsg;
|
68
|
-
|
69
|
-
if (formatter)
|
70
|
-
{
|
71
|
-
logMsg = [formatter formatLogMessage:logMessage];
|
72
|
-
}
|
73
|
-
|
74
|
-
if (logMsg)
|
75
|
-
{
|
76
|
-
const char *msg = [logMsg UTF8String];
|
77
|
-
|
78
|
-
int aslLogLevel;
|
79
|
-
switch (logMessage->logLevel)
|
80
|
-
{
|
81
|
-
// Note: By default ASL will filter anything above level 5 (Notice).
|
82
|
-
// So our mappings shouldn't go above that level.
|
83
|
-
|
84
|
-
case 1 : aslLogLevel = ASL_LEVEL_CRIT; break;
|
85
|
-
case 2 : aslLogLevel = ASL_LEVEL_ERR; break;
|
86
|
-
case 3 : aslLogLevel = ASL_LEVEL_WARNING; break;
|
87
|
-
default : aslLogLevel = ASL_LEVEL_NOTICE; break;
|
88
|
-
}
|
89
|
-
|
90
|
-
asl_log(client, NULL, aslLogLevel, "%s", msg);
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
- (NSString *)loggerName
|
95
|
-
{
|
96
|
-
return @"cocoa.lumberjack.aslLogger";
|
97
|
-
}
|
98
|
-
|
99
|
-
@end
|
@@ -1,102 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
|
3
|
-
#import "DDLog.h"
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Welcome to Cocoa Lumberjack!
|
7
|
-
*
|
8
|
-
* The project page has a wealth of documentation if you have any questions.
|
9
|
-
* https://github.com/robbiehanson/CocoaLumberjack
|
10
|
-
*
|
11
|
-
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
12
|
-
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
|
13
|
-
*
|
14
|
-
*
|
15
|
-
* This class provides an abstract implementation of a database logger.
|
16
|
-
*
|
17
|
-
* That is, it provides the base implementation for a database logger to build atop of.
|
18
|
-
* All that is needed for a concrete database logger is to extend this class
|
19
|
-
* and override the methods in the implementation file that are prefixed with "db_".
|
20
|
-
**/
|
21
|
-
|
22
|
-
@interface DDAbstractDatabaseLogger : DDAbstractLogger {
|
23
|
-
@protected
|
24
|
-
NSUInteger saveThreshold;
|
25
|
-
NSTimeInterval saveInterval;
|
26
|
-
NSTimeInterval maxAge;
|
27
|
-
NSTimeInterval deleteInterval;
|
28
|
-
BOOL deleteOnEverySave;
|
29
|
-
|
30
|
-
BOOL saveTimerSuspended;
|
31
|
-
NSUInteger unsavedCount;
|
32
|
-
dispatch_time_t unsavedTime;
|
33
|
-
dispatch_source_t saveTimer;
|
34
|
-
dispatch_time_t lastDeleteTime;
|
35
|
-
dispatch_source_t deleteTimer;
|
36
|
-
}
|
37
|
-
|
38
|
-
/**
|
39
|
-
* Specifies how often to save the data to disk.
|
40
|
-
* Since saving is an expensive operation (disk io) it is not done after every log statement.
|
41
|
-
* These properties allow you to configure how/when the logger saves to disk.
|
42
|
-
*
|
43
|
-
* A save is done when either (whichever happens first):
|
44
|
-
*
|
45
|
-
* - The number of unsaved log entries reaches saveThreshold
|
46
|
-
* - The amount of time since the oldest unsaved log entry was created reaches saveInterval
|
47
|
-
*
|
48
|
-
* You can optionally disable the saveThreshold by setting it to zero.
|
49
|
-
* If you disable the saveThreshold you are entirely dependent on the saveInterval.
|
50
|
-
*
|
51
|
-
* You can optionally disable the saveInterval by setting it to zero (or a negative value).
|
52
|
-
* If you disable the saveInterval you are entirely dependent on the saveThreshold.
|
53
|
-
*
|
54
|
-
* It's not wise to disable both saveThreshold and saveInterval.
|
55
|
-
*
|
56
|
-
* The default saveThreshold is 500.
|
57
|
-
* The default saveInterval is 60 seconds.
|
58
|
-
**/
|
59
|
-
@property (assign, readwrite) NSUInteger saveThreshold;
|
60
|
-
@property (assign, readwrite) NSTimeInterval saveInterval;
|
61
|
-
|
62
|
-
/**
|
63
|
-
* It is likely you don't want the log entries to persist forever.
|
64
|
-
* Doing so would allow the database to grow infinitely large over time.
|
65
|
-
*
|
66
|
-
* The maxAge property provides a way to specify how old a log statement can get
|
67
|
-
* before it should get deleted from the database.
|
68
|
-
*
|
69
|
-
* The deleteInterval specifies how often to sweep for old log entries.
|
70
|
-
* Since deleting is an expensive operation (disk io) is is done on a fixed interval.
|
71
|
-
*
|
72
|
-
* An alternative to the deleteInterval is the deleteOnEverySave option.
|
73
|
-
* This specifies that old log entries should be deleted during every save operation.
|
74
|
-
*
|
75
|
-
* You can optionally disable the maxAge by setting it to zero (or a negative value).
|
76
|
-
* If you disable the maxAge then old log statements are not deleted.
|
77
|
-
*
|
78
|
-
* You can optionally disable the deleteInterval by setting it to zero (or a negative value).
|
79
|
-
*
|
80
|
-
* If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted.
|
81
|
-
*
|
82
|
-
* It's not wise to enable both deleteInterval and deleteOnEverySave.
|
83
|
-
*
|
84
|
-
* The default maxAge is 7 days.
|
85
|
-
* The default deleteInterval is 5 minutes.
|
86
|
-
* The default deleteOnEverySave is NO.
|
87
|
-
**/
|
88
|
-
@property (assign, readwrite) NSTimeInterval maxAge;
|
89
|
-
@property (assign, readwrite) NSTimeInterval deleteInterval;
|
90
|
-
@property (assign, readwrite) BOOL deleteOnEverySave;
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Forces a save of any pending log entries (flushes log entries to disk).
|
94
|
-
**/
|
95
|
-
- (void)savePendingLogEntries;
|
96
|
-
|
97
|
-
/**
|
98
|
-
* Removes any log entries that are older than maxAge.
|
99
|
-
**/
|
100
|
-
- (void)deleteOldLogEntries;
|
101
|
-
|
102
|
-
@end
|