fix: changing to log4uni, because of log4net issues in build versions

This commit is contained in:
Jakob Feldmann 2024-04-19 21:33:19 +02:00
parent 29f2bd1bec
commit ef425d0ea5
24 changed files with 827 additions and 130 deletions

View File

@ -337,34 +337,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 1178560132}
m_Modifications:
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: No
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 106129460808279082, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_SizeDelta.y
value: -12.6
@ -525,6 +497,34 @@ PrefabInstance:
propertyPath: m_Name
value: No Button
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: No
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -984,34 +984,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 1986215051}
m_Modifications:
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: Yes
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 106129460808279082, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_SizeDelta.y
value: -12.6
@ -1036,6 +1008,10 @@ PrefabInstance:
propertyPath: m_fontSize
value: 53.9
objectReference: {fileID: 0}
- target: {fileID: 2836659166924155329, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4688621401141212590, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_Delegates.Array.data[0].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
@ -1160,6 +1136,34 @@ PrefabInstance:
propertyPath: m_Name
value: Yes Button
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: Yes
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -2667,10 +2671,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 2011926118}
m_Modifications:
- target: {fileID: 5415181396576777827, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 106129460808279082, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_AnchoredPosition.y
value: -4
@ -2853,6 +2853,10 @@ PrefabInstance:
propertyPath: m_Name
value: Exit Button
objectReference: {fileID: 0}
- target: {fileID: 5415181396576777827, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -2882,34 +2886,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 1986215051}
m_Modifications:
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: No
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 106129460808279082, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_SizeDelta.y
value: -12.6
@ -2946,6 +2922,10 @@ PrefabInstance:
propertyPath: m_fontSize
value: 49.5
objectReference: {fileID: 0}
- target: {fileID: 2836659166924155329, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4688621401141212590, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_Delegates.Array.data[0].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
@ -3070,6 +3050,34 @@ PrefabInstance:
propertyPath: m_Name
value: No Button
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: No
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -3166,34 +3174,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 1178560132}
m_Modifications:
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: Yes
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 106129460808279082, guid: e269e0cd8b46eb94a8c118dc84754c33, type: 3}
propertyPath: m_SizeDelta.y
value: -12.6
@ -3342,6 +3322,34 @@ PrefabInstance:
propertyPath: m_Name
value: Yes Button
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_text
value: Yes
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textAlignment
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.lineCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.pageCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.wordCount
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_HorizontalAlignment
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5389521700824258581, guid: 817319833dd713d45af5c2121e9649c7, type: 3}
propertyPath: m_textInfo.characterCount
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []

View File

@ -90,10 +90,7 @@ namespace Managers
{
log4net.GlobalContext.Properties["LogFileName"] = $"{Application.dataPath}" +
"\\Logging\\SSOLog";
var fi = new FileInfo($"{Application.dataPath}" +
"\\Logging\\Log4NetConfiguration.xml");
XmlConfigurator.Configure(fi);
Log.Debug("Log4Net configured.");
// Log.Debug("Log4Net configured.");
}
/// <summary>

Binary file not shown.

View File

@ -13,6 +13,12 @@
value=" %message | %logger | Thread: [%thread] %date{ss:fff}ms %newline" />
</layout>
</appender>
<appender name="unityConsole" type="log4net.Unity.UnityDefaultLogAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%thread][%level][%logger] %message"/>
</layout>
</appender>
<!-- Rolling file appender -->
<appender name="File" type="log4net.Appender.RollingFileAppender">

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7c1001ab95d71c345aac765158c01a9f
guid: 46804775b56e0324cb026fee279425ee
TextScriptImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 13e70c295bae521458004f57dfd9a2a9
guid: 9131c6ca36625b44180bc88c303f8e89
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -0,0 +1,53 @@
# 1.0.5
* [Fix] Exception messages now has clickable source code links for Unity 2020+ versions
# 1.0.4
* [Deploy] Now github actions not build release if no changes in source files detected
* [Deploy] Now github actions not try upload new release if version of package not changed
* [Update] Update log4net to 2.0.12
* [Fix] Remove all ASP, System.Web, Mutex and some OS related features from log4net for better compatibility with some Unity platforms
* [Fix] All dll's now has better linker information for code stripping process
# 1.0.3
* [Feature] log4net.editor and log4net.runtime files now supported as config files in default configurators
# 1.0.2
* [Deploy] Add some lost meta files
* [Info] Add author info
# 1.0.1
* [Deploy] Add auto deployment
# 1.0.0
* [Refactor] Rename project and all assemblies to match unity convention.
* [WIP] Build folder now can be used as local package for unity. Package branch and publication in public npm repository still in progress.
# 0.3.3
* [Fix] Silent crash of editor when start with non compiled scripts no longer happens.
# 0.3.2
* [Add] Add context object as log event property.
# 0.3.1
* [Fix] Infinity exception loops in editor start or recompile no longer happens.
# 0.2.2
* [Fix] Change editor initialization algorithm.
# 0.2.1
* [Feature] Exception stack trace now clickable in editor console.
# 0.0.0
* Begin of journey =)

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7c29e57692dc4cf39b38af880788a530
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ed59742223874bc1bc700f6078e62fd8
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: e0a45af9bf6b3b445aea3dd011c5066d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2c5c378cb78e84540a097dc8c84dc678
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
log4uni
Copyright 2021 Holy Shovel Soft
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Licensed under the Apache License 2.0.
With modifications especialy for Unity Engine:
- make log4net.Util.SystemInfo.GetAppSetting(string key) always return null for compatibility with some platforms reason (Holy Shovel Soft 2019)
- remove all ASP related features (appenders and templates) (Holy Shovel Soft 2021)
- remove all System.Web usages (appenders and templates) (Holy Shovel Soft 2021)
- remove all Mutex usages (FileAppender and RollingFileAppender) (Holy Shovel Soft 2021)
This product use software developed by Jb Evain
Licensed under the MIT License

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 62dfff47a3671b048a6de1a508d67919
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,205 @@
# log4uni
[![openupm](https://img.shields.io/npm/v/com.holyshovelsoft.opensource.log4uni?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.holyshovelsoft.opensource.log4uni/)
[![release](https://img.shields.io/github/v/release/holyshovelsoft/log4uni.svg)](https://github.com/HolyShovelSoft/log4uni/releases/latest)
This package its [log4net](https://logging.apache.org/log4net/) wrapper and UnityEngine.Debug appender for Unity.
For greater compatibility .NET Framework 3.5 is used.
This project was tested only on platforms available to the author (Windows, Android, WebGL), but we expect that plugin must work fine on other plaforms, supported by **Unity**.
> Projects author does not guarantee **log4net** or third-party **Appenders** working properly, as some platforms are limited in their abilities, and could not be supporting some **.net** functions.
> Also this package use custom patched **log4net.dll** (2.0.12) for work with **Unity** il2cpp and AOT platforms.
## Instalation
### Manual
1. Download the latest release at [link](https://github.com/HolyShovelSoft/log4net.unity/releases).
2. Unpack files into your Unity project.
3. Make sure that log4uni.editor.dll is set up to be used only in the editor.
### As package from git
You can use this tool as package via git link `ssh://git@github.com:HolyShovelSoft/log4uni.git#upm` or `https://github.com/HolyShovelSoft/log4uni.git#upm`. About installation packages from git you can read in this [manual](https://docs.unity3d.com/Manual/upm-ui-giturl.html).
### As package from **OpenUPM**
[Link to package](https://openupm.com/packages/com.holyshovelsoft.opensource.log4uni/)
You can install it with OpenUPM CLI with code
```
openupm add com.holyshovelsoft.opensource.log4uni
```
About installation and using OpenUPM CLI you can read [here](https://openupm.com/docs/getting-started.html).
The second installation method is [scoped registries](https://docs.unity3d.com/Manual/upm-scoped.html). You need add registry `https://package.openupm.com` with name **OpenUPM** for scope `com.holyshovelsoft.opensource`.
## UnityDefaultLogAppender and Unity log handlers
**UnityDefaultLogAppender** is an **Appender** for log4net, which integrates log4net loggers with Unity logger (for both runtime and editor). This plugin also replaces default Unity **ILogHandler** with a handler which sends all **Debug.Log** standard calls into log4net and lets you control default logging method with configurations.
All standard calls will be interpreted as log4net loggers with a name "Unity".
## Very Simple Usage
After installation all that's required is to use old methods in the code:
``` csharp
//In this case common ILog instance will be used
Debug.Log("Debug message");
```
Or to use loggers as indended by log4net =)
``` csharp
private static readonly ILog Log = LogManager.GetLogger("MyLogger");
//or
private static readonly ILog Log = LogManager.GetLogger(typeof(MyType));
//and after it use this instances for logs
if (Log.IsInfoEnabled)
{
Log.Info("Info message");
}
//or for .net 4.6 and higher you can use extention methods
Log.Info()?.Call("Info message");
```
Thats it, you are great, you are already using log4net! =)
## Simple Usage
But what about configurations and what we love log4net for? There are several ways to configure log4net in this plugin. The easiest is to place log4net configuration file( the only addition requirment is that **log4net** node must be root) in the following places (in the checking order):
1. Into the folder **Application.persistentDataPath**. Valid configuration files are
- **log4net.editor.xml**, **log4net.editor.config** or **log4net.editor.txt** for editor configuration.
- **log4net.runtime.xml**, **log4net.runtime.config** or **log4net.runtime.txt** for runtime build configuration.
- **log4net.xml**, **log4net.config** or **log4net.txt** for both (editor and runtime build).
2. Into the folder **Application.dataPath**. Valid configuration files are
- **log4net.editor.xml**, **log4net.editor.config** or **log4net.editor.txt** for editor configuration.
- **log4net.runtime.xml**, **log4net.runtime.config** or **log4net.runtime.txt** for runtime build configuration.
- **log4net.xml**, **log4net.config** or **log4net.txt** for both (editor and runtime build).
3. Into any Resources folder within the project. Files placed in subfolders not supported. Its must be any **TextAsset**. Valid asset names are:
- **log4net.editor** for editor configuration.
- **log4net.runtime** for runtime build configuration.
- **log4net** for both (editor and runtime build).
In case none of the following configuration acquisition methods doesn't find a valid configuration, default configuration will be used. In particular:
``` xml
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<appender name="unityConsole" type="log4net.Unity.UnityDefaultLogAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%thread][%level][%logger] %message"/>
</layout>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="unityConsole"/>
</root>
</log4net>
```
When any of the files if updated when working in editor, log4net reconfiguration will be called. In build file updating is not tracked, only the state at launch is considered.
> This configuration can also be saved to file using **Unity** command **Tools/log4net/Make Default Config**.
## Advanced Usage
But what if we need to configure log4net with code, and not by updating configuration file, or to use complex conditions for selecting configuration? In this case you can use the following interface to customize configuration process:
``` csharp
public interface IConfigurator
{
int Order { get; }
event Action OnChange;
void TryConfigure();
}
```
To understand this interface, we need to understand how configuration works in this plugin. When launching editor (and when recompiling) or during the build running the following operations occur:
1. Reset of existing log4net configuration.
2. Collect of all information about **IConfigurator** interface implementations.
3. Filling in the list of all found configuratiors according to the following rules:
- Classes (not nested), not inhereted from **UnityEngine.Object**, that have constructor without parameters (or without declared constructors) and not marked with a **[ExcludeFromSearch]** attribute, are instantiated automatically and are placed in the common configurators list.
- Objects inherited from **ScriptableObject** and placed in **Resources** are also placed in the common configurators list.
- Default configurators added to the list (with the highest possible **Order** value).
4. Resulting list is sorted from the lowest **Order** value to highest.
5. Every configurator in the list is calling a method **TryConfigure** one by one. If after calling that method **log4net** is configurated, then list iterating is stopped.
Besides this you can also use following methods to add or delete configurators:
``` csharp
ConfigProcessor.AddConfigurator(myConfigurator);
ConfigProcessor.RemoveConfigurator(myConfigurator);
```
Calling these methods causes reconfiguration, as well as triggering **OnChange** event in any configurator added to the list.
> **Imprtant**
> If you need to use logging inside configurator, use **UnityDefaultLogHandler.DefaultUnityLogger**. This is necessary because during configurators work, log4net is not configured and all logs will go into the void. **UnityDefaultLogHandler.DefaultUnityLogger** is a fallback to a standard **Unity** logging system.
## Configurators samples
``` csharp
[ExcludeFromSearch]
public class SimpleXMLConfigurator : IConfigurator
{
public int Order { get; }
public event Action OnChange;
private string xml;
public SimpleXMLConfigurator(int order, string xml)
{
Order = order;
this.xml = xml;
}
public void TryConfigure()
{
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
log4net.Config.XmlConfigurator.Configure(xmlDoc.DocumentElement);
}
}
```
``` csharp
[ExcludeFromSearch]
public class SimpleCodeConfigurator : IConfigurator
{
public int Order { get; }
public event Action OnChange;
public SimpleCodeConfigurator(int order)
{
Order = order;
}
public void TryConfigure()
{
var hierarchy = (Hierarchy)LogManager.GetRepository();
var patternLayout = new PatternLayout();
patternLayout.ConversionPattern = "[%thread][%level][%logger] %message";
patternLayout.ActivateOptions();
var appender = new UnityDefaultLogAppender();
appender.Layout = patternLayout;
hierarchy.Root.AddAppender(appender);
hierarchy.Root.Level = Level.Info;
hierarchy.Configured = true;
}
}
```
## Contacts
- [twitter.com/holyshovelsoft](https://twitter.com/holyshovelsoft)
- [support@holyshovelsoft.com](mailto:support@holyshovelsoft.com)
- [andreich@holyshovelsoft.com](mailto:andreich@holyshovelsoft.com)

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7153e10cfeec42d4879694d52890757c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6b05703ded3591c46a671e4977492a3e
guid: ffda049d4c0ac8944953e736728028af
PluginImporter:
externalObjects: {}
serializedVersion: 2
@ -9,7 +9,6 @@ PluginImporter:
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:

Binary file not shown.

View File

@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 8fc9fb3fde8b09e40afdd6740a270db4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
{
"name": "com.holyshovelsoft.opensource.log4uni",
"displayName": "log4uni",
"version": "1.0.5",
"unity": "2019.1",
"description": "log4net wrapper and UnityEngine.Debug appender for Unity.",
"keywords": [
"tool",
"log",
"log4net",
"unity"
],
"dependencies": {
},
"author": {
"name": "Holy Shovel Soft",
"email": "support@holyshovelsoft.com",
"url": "https://github.com/HolyShovelSoft/log4uni.git"
},
"repository": {
"url": "https://github.com/HolyShovelSoft/log4uni.git",
"type": "git"
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e1882989817643caba88c9f39a4d92c8
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -140,9 +140,7 @@ PlayerSettings:
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 0.1
preloadedAssets:
- {fileID: -4938997134116425971, guid: 4b98f800e99c70140ac675a637d71d3a, type: 2}
- {fileID: 11400000, guid: 7d6dd64b5f2213d4f8cc395ae58ffb43, type: 2}
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
@ -347,7 +345,7 @@ PlayerSettings:
m_Automatic: 1
- m_BuildTarget: WebGLSupport
m_APIs: 0b000000
m_Automatic: 1
m_Automatic: 0
m_BuildTargetVRSettings:
- m_BuildTarget: Standalone
m_Enabled: 0
@ -658,13 +656,14 @@ PlayerSettings:
Stadia: UNITY_POST_PROCESSING_STACK_V2
Standalone: UNITY_POST_PROCESSING_STACK_V2;FISHNET;FISHNET_V4
VisionOS: UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2;FISHNET;FISHNET_V4
XboxOne: UNITY_POST_PROCESSING_STACK_V2
tvOS: UNITY_POST_PROCESSING_STACK_V2
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
il2cppCompilerConfiguration:
WebGL: 0
il2cppCodeGeneration: {}
managedStrippingLevel:
EmbeddedLinux: 1