forked from CocoaLumberjack/CocoaLumberjack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
53 lines (43 loc) · 1.74 KB
/
ViewController.m
File metadata and controls
53 lines (43 loc) · 1.74 KB
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
// Software License Agreement (BSD License)
//
// Copyright (c) 2010-2026, Deusty, LLC
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms,
// with or without modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Neither the name of Deusty nor the names of its contributors may be used
// to endorse or promote products derived from this software without specific
// prior written permission of Deusty, LLC.
#import "ViewController.h"
#import <CocoaLumberjack/CocoaLumberjack.h>
static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if (@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)) {
[DDLog addLogger:[DDOSLogger sharedInstance]];
} else {
[DDLog addLogger:(DDTTYLogger *)[DDTTYLogger sharedInstance]];
}
DDLogVerbose(@"Verbose");
DDLogInfo(@"Info");
DDLogWarn(@"Warn");
DDLogError(@"Error");
DDLog *aDDLogInstance = [DDLog new];
if (@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)) {
[aDDLogInstance addLogger:[DDOSLogger sharedInstance]];
} else {
[aDDLogInstance addLogger:(DDTTYLogger *)[DDTTYLogger sharedInstance]];
}
DDLogVerboseToDDLog(aDDLogInstance, @"Verbose from aDDLogInstance");
DDLogInfoToDDLog(aDDLogInstance, @"Info from aDDLogInstance");
DDLogWarnToDDLog(aDDLogInstance, @"Warn from aDDLogInstance");
DDLogErrorToDDLog(aDDLogInstance, @"Error from aDDLogInstance");
}
@end