Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
parkwoocheol committed Aug 23, 2017
1 parent c5c5906 commit 2e3bc76
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion SimpleLog-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'SimpleLog-Swift'
s.version = ‘1.0.3
s.version = '1.1.0'
s.summary = 'Simple Log for Swift by Park, Woocheol'


Expand Down
28 changes: 16 additions & 12 deletions SimpleLog-Swift/Classes/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ public class Logging{

public static func d(_ message: Any, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .DEBUG, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .DEBUG, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
mirror(message)
}
}

public static func d(file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .DEBUG, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .DEBUG, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
}
}

public static func d(_ target: Array<Any>, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .DEBUG, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .DEBUG, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
printArrayInfoMessage(target, size: target.count)
for (index ,any) in target.enumerated() {
printIndexMessage(index)
Expand All @@ -57,20 +57,20 @@ public class Logging{
}
public static func i(_ message: Any, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .INFO, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .INFO, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
mirror(message)
}
}

public static func i(file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .INFO, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .INFO, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
}
}

public static func i(_ target: Array<Any>, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .INFO, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .INFO, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
printArrayInfoMessage(target, size: target.count)
for (index ,any) in target.enumerated() {
printIndexMessage(index)
Expand All @@ -81,20 +81,20 @@ public class Logging{

public static func w(_ message: Any, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .WARN, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .WARN, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
mirror(message)
}
}

public static func w(file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .WARN, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .WARN, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
}
}

public static func w(_ target: Array<Any>, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .WARN, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .WARN, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
printArrayInfoMessage(target, size: target.count)
for (index ,any) in target.enumerated() {
printIndexMessage(index)
Expand All @@ -105,20 +105,20 @@ public class Logging{

public static func e(_ message: Any, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .ERROR, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .ERROR, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
mirror(message)
}
}

public static func e(file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .ERROR, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .ERROR, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
}
}

public static func e(_ target: Array<Any>, file: String = #file, function: String = #function, line: Int = #line){
if isRunning {
printLogMessage(separator: .ERROR, logMessage: "File: \(file), Function: \(function), Line: \(line)")
printLogMessage(separator: .ERROR, logMessage: "File: \(getFile(file)), Function: \(function), Line: \(line)")
printArrayInfoMessage(target, size: target.count)
for (index ,any) in target.enumerated() {
printIndexMessage(index)
Expand All @@ -127,6 +127,10 @@ public class Logging{
}
}

public static func getFile(_ file: String) -> String{
return file.components(separatedBy: "/")[file.components(separatedBy: "/").count-1]
}

public static func printLogMessage(separator: LogSeparator,logMessage: Any){
print("| \(separator.rawValue) | \(logMessage)")
}
Expand Down

0 comments on commit 2e3bc76

Please sign in to comment.