From 6a5ad420a6ba8f5c7538a57da43b1a8bca57398c Mon Sep 17 00:00:00 2001 From: Josef Zoller Date: Tue, 9 Oct 2018 23:25:52 +0200 Subject: [PATCH 1/2] Moving global StORMdebug variable under new StORMDebug struct --- Sources/StORM/StORM.swift | 5 ----- Sources/StORM/StORMDebug.swift | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 Sources/StORM/StORMDebug.swift diff --git a/Sources/StORM/StORM.swift b/Sources/StORM/StORM.swift index 6903f37..6162c8f 100644 --- a/Sources/StORM/StORM.swift +++ b/Sources/StORM/StORM.swift @@ -7,11 +7,6 @@ // April 6, 2017: 1.0.3, add support for storing [String] as comma delimited strings -/// Variable defining the global debug state for all classes inheriting from the StORM superclass. -/// When true, certain methods will generate a debug message under certain conditions. -public var StORMdebug = false - - /// Base StORM superclass from which all Database-Connector StORM classes inherit. /// Provides base functionality and rules. open class StORM { diff --git a/Sources/StORM/StORMDebug.swift b/Sources/StORM/StORMDebug.swift new file mode 100644 index 0000000..8582fda --- /dev/null +++ b/Sources/StORM/StORMDebug.swift @@ -0,0 +1,16 @@ +// +// StORMDebug.swift +// StORM +// +// Created by Josef Zoller on 09.10.18. +// + +/// StORMDebug sets, whether or not some methods of StORM classes generate debug messages +/// and where the log file is located +public struct StORMDebug { + private init(){} + + /// The global debug state for all classes inheriting from the StORM superclass. + /// When true, certain methods will generate a debug message under certain conditions. + public static var active = false +} From 7b6da48488e102f373515f69d3e19233a4d39058 Mon Sep 17 00:00:00 2001 From: Josef Zoller Date: Tue, 9 Oct 2018 23:26:18 +0200 Subject: [PATCH 2/2] Adding log file location variable to StORMDebug struct --- Sources/StORM/StORMDebug.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/StORM/StORMDebug.swift b/Sources/StORM/StORMDebug.swift index 8582fda..1e782f0 100644 --- a/Sources/StORM/StORMDebug.swift +++ b/Sources/StORM/StORMDebug.swift @@ -13,4 +13,8 @@ public struct StORMDebug { /// The global debug state for all classes inheriting from the StORM superclass. /// When true, certain methods will generate a debug message under certain conditions. public static var active = false + + /// The location of the log file. + /// The default location is relative, "StORMlog.txt" + public static var location = "./StORMlog.txt" }