Skip to content

Commit

Permalink
Revert "Remove CocoaLumberjack sources from LPTestTarget."
Browse files Browse the repository at this point in the history
This reverts commit 77cb847.
  • Loading branch information
IlyaBausovAkvelon committed Mar 7, 2023
1 parent 99130d4 commit c590c61
Show file tree
Hide file tree
Showing 26 changed files with 8,294 additions and 0 deletions.
44 changes: 44 additions & 0 deletions LPTestTarget/CocoaLumberjack/CLI/CLIColor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Software License Agreement (BSD License)
//
// Copyright (c) 2010-2015, 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 <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>

/**
* This class represents an NSColor replacement for CLI projects that don't link with AppKit
**/
@interface CLIColor : NSObject

/**
* Convenience method for creating a `CLIColor` instance from RGBA params
*
* @param red red channel, between 0 and 1
* @param green green channel, between 0 and 1
* @param blue blue channel, between 0 and 1
* @param alpha alpha channel, between 0 and 1
*/
+ (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;

/**
* Get the RGBA components from a `CLIColor`
*
* @param red red channel, between 0 and 1
* @param green green channel, between 0 and 1
* @param blue blue channel, between 0 and 1
* @param alpha alpha channel, between 0 and 1
*/
- (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha;

@end
55 changes: 55 additions & 0 deletions LPTestTarget/CocoaLumberjack/CLI/CLIColor.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Software License Agreement (BSD License)
//
// Copyright (c) 2010-2015, 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 "CLIColor.h"

@interface CLIColor () {
CGFloat _red, _green, _blue, _alpha;
}

@end


@implementation CLIColor

+ (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha {
CLIColor *color = [CLIColor new];

color->_red = red;
color->_green = green;
color->_blue = blue;
color->_alpha = alpha;
return color;
}

- (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha {
if (red) {
*red = _red;
}

if (green) {
*green = _green;
}

if (blue) {
*blue = _blue;
}

if (alpha) {
*alpha = _alpha;
}
}

@end
81 changes: 81 additions & 0 deletions LPTestTarget/CocoaLumberjack/CocoaLumberjack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Software License Agreement (BSD License)
//
// Copyright (c) 2010-2015, 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.

/**
* Welcome to CocoaLumberjack!
*
* The project page has a wealth of documentation if you have any questions.
* https://github.com/CocoaLumberjack/CocoaLumberjack
*
* If you're new to the project you may wish to read "Getting Started" at:
* Documentation/GettingStarted.md
*
* Otherwise, here is a quick refresher.
* There are three steps to using the macros:
*
* Step 1:
* Import the header in your implementation or prefix file:
*
* #import <CocoaLumberjack/CocoaLumberjack.h>
*
* Step 2:
* Define your logging level in your implementation file:
*
* // Log levels: off, error, warn, info, verbose
* static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
*
* Step 2 [3rd party frameworks]:
*
* Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel:
*
* // #undef LOG_LEVEL_DEF // Undefine first only if needed
* #define LOG_LEVEL_DEF myLibLogLevel
*
* Define your logging level in your implementation file:
*
* // Log levels: off, error, warn, info, verbose
* static const DDLogLevel myLibLogLevel = DDLogLevelVerbose;
*
* Step 3:
* Replace your NSLog statements with DDLog statements according to the severity of the message.
*
* NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!");
*
* DDLog works exactly the same as NSLog.
* This means you can pass it multiple variables just like NSLog.
**/

#import <Foundation/Foundation.h>

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
#define DD_LEGACY_MACROS 0
#endif

// Core
#import "DDLog.h"

// Main macros
#import "DDLogMacros.h"
#import "DDAssertMacros.h"

// Capture ASL
#import "DDASLLogCapture.h"

// Loggers
#import "DDTTYLogger.h"
#import "DDASLLogger.h"
#import "DDFileLogger.h"

48 changes: 48 additions & 0 deletions LPTestTarget/CocoaLumberjack/DDASLLogCapture.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Software License Agreement (BSD License)
//
// Copyright (c) 2010-2015, 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 "DDASLLogger.h"

@protocol DDLogger;

/**
* This class provides the ability to capture the ASL (Apple System Logs)
*/
@interface DDASLLogCapture : NSObject

/**
* Start capturing logs
*/
+ (void)start;

/**
* Stop capturing logs
*/
+ (void)stop;

/**
* Returns the current capture level.
* @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages).
*/
+ (DDLogLevel)captureLevel;

/**
* Set the capture level
*
* @param level new level
*/
+ (void)setCaptureLevel:(DDLogLevel)level;

@end
Loading

0 comments on commit c590c61

Please sign in to comment.