-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
135 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// TestDelegate.swift | ||
// Woody | ||
// | ||
// Created by Kaden Wilkinson on 9/5/17. | ||
// Copyright © 2017 Vivint.SmartHome. All rights reserved. | ||
// | ||
|
||
import Woody | ||
|
||
|
||
struct Log: Equatable { | ||
let message: String | ||
let filepath: String | ||
let function: String | ||
let line: Int | ||
|
||
static func ==(lhs: Log, rhs: Log) -> Bool { | ||
return lhs.message == rhs.message && | ||
lhs.filepath == rhs.filepath && | ||
lhs.function == rhs.function && | ||
lhs.line == rhs.line | ||
} | ||
} | ||
|
||
|
||
class TestDelegate: WoodyDelegate { | ||
|
||
var verboseLogs = [Log]() | ||
var debugLogs = [Log]() | ||
var infoLogs = [Log]() | ||
var warningLogs = [Log]() | ||
var errorLogs = [Log]() | ||
|
||
|
||
func verbose(_ msg: String, filepath: String, function: String, line: Int) { | ||
verboseLogs.append(Log(message: msg, filepath: filepath, function: function, line: line)) | ||
} | ||
|
||
func debug(_ msg: String, filepath: String, function: String, line: Int) { | ||
debugLogs.append(Log(message: msg, filepath: filepath, function: function, line: line)) | ||
} | ||
|
||
func info(_ msg: String, filepath: String, function: String, line: Int) { | ||
infoLogs.append(Log(message: msg, filepath: filepath, function: function, line: line)) | ||
} | ||
|
||
func warning(_ msg: String, filepath: String, function: String, line: Int) { | ||
warningLogs.append(Log(message: msg, filepath: filepath, function: function, line: line)) | ||
} | ||
|
||
func error(_ msg: String, filepath: String, function: String, line: Int) { | ||
errorLogs.append(Log(message: msg, filepath: filepath, function: function, line: line)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters