-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from nowsprinting/feature/logger
Pluggable loggers including FileLogger
- Loading branch information
Showing
45 changed files
with
1,273 additions
and
208 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,35 @@ | ||
// Copyright (c) 2023-2024 DeNA Co., Ltd. | ||
// This software is released under the MIT License. | ||
|
||
using DeNA.Anjin.Loggers; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace DeNA.Anjin.Editor.UI.Loggers | ||
{ | ||
/// <summary> | ||
/// Editor GUI for CompositeLogger. | ||
/// </summary> | ||
[CustomEditor(typeof(CompositeLoggerAsset))] | ||
public class CompositeLoggerEditor : UnityEditor.Editor | ||
{ | ||
private static readonly string s_description = L10n.Tr("Description"); | ||
private static readonly string s_descriptionTooltip = L10n.Tr("Description about this logger instance"); | ||
|
||
private static readonly string s_loggers = L10n.Tr("Loggers"); | ||
private static readonly string s_loggersTooltip = L10n.Tr("Loggers to delegates"); | ||
|
||
/// <inheritdoc/> | ||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(CompositeLoggerAsset.description)), | ||
new GUIContent(s_description, s_descriptionTooltip)); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(CompositeLoggerAsset.loggerAssets)), | ||
new GUIContent(s_loggers, s_loggersTooltip)); | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,35 @@ | ||
// Copyright (c) 2023-2024 DeNA Co., Ltd. | ||
// This software is released under the MIT License. | ||
|
||
using DeNA.Anjin.Loggers; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace DeNA.Anjin.Editor.UI.Loggers | ||
{ | ||
/// <summary> | ||
/// Editor GUI for ConsoleLogger. | ||
/// </summary> | ||
[CustomEditor(typeof(ConsoleLoggerAsset))] | ||
public class ConsoleLoggerEditor : UnityEditor.Editor | ||
{ | ||
private static readonly string s_description = L10n.Tr("Description"); | ||
private static readonly string s_descriptionTooltip = L10n.Tr("Description about this logger instance"); | ||
|
||
private static readonly string s_filterLogType = L10n.Tr("Filter LogType"); | ||
private static readonly string s_filterLogTypeTooltip = L10n.Tr("To selective enable debug log message"); | ||
|
||
/// <inheritdoc/> | ||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(ConsoleLoggerAsset.description)), | ||
new GUIContent(s_description, s_descriptionTooltip)); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(ConsoleLoggerAsset.filterLogType)), | ||
new GUIContent(s_filterLogType, s_filterLogTypeTooltip)); | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,45 @@ | ||
// Copyright (c) 2023-2024 DeNA Co., Ltd. | ||
// This software is released under the MIT License. | ||
|
||
using DeNA.Anjin.Loggers; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace DeNA.Anjin.Editor.UI.Loggers | ||
{ | ||
/// <summary> | ||
/// Editor GUI for FileLogger. | ||
/// </summary> | ||
[CustomEditor(typeof(FileLoggerAsset))] | ||
public class FileLoggerEditor : UnityEditor.Editor | ||
{ | ||
private static readonly string s_description = L10n.Tr("Description"); | ||
private static readonly string s_descriptionTooltip = L10n.Tr("Description about this logger instance"); | ||
|
||
private static readonly string s_outputPath = L10n.Tr("Output File Path"); | ||
private static readonly string s_outputPathTooltip = L10n.Tr("Log output file path. Specify relative path from project root or absolute path."); | ||
|
||
private static readonly string s_filterLogType = L10n.Tr("Filter LogType"); | ||
private static readonly string s_filterLogTypeTooltip = L10n.Tr("To selective enable debug log message"); | ||
|
||
private static readonly string s_timestamp = L10n.Tr("Timestamp"); | ||
private static readonly string s_timestampTooltip = L10n.Tr("Output timestamp to log entities"); | ||
|
||
/// <inheritdoc/> | ||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(FileLoggerAsset.description)), | ||
new GUIContent(s_description, s_descriptionTooltip)); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(FileLoggerAsset.outputPath)), | ||
new GUIContent(s_outputPath, s_outputPathTooltip)); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(FileLoggerAsset.filterLogType)), | ||
new GUIContent(s_filterLogType, s_filterLogTypeTooltip)); | ||
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(FileLoggerAsset.timestamp)), | ||
new GUIContent(s_timestamp, s_timestampTooltip)); | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.