-
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.
Merge branch 'develop' into 'master'
Develop See merge request VR-Group/unreal-development/plugins/universallogging!16
- Loading branch information
Showing
19 changed files
with
521 additions
and
94 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,94 @@ | ||
#------------------------------------------------------------------------------- | ||
# Copyright (c) 2020 RWTH Aachen University, Germany, | ||
# Virtual Reality & Immersive Visualisation Group. | ||
#------------------------------------------------------------------------------- | ||
|
||
# The include file can be change to either be removed or reference a specific commit. | ||
|
||
include: | ||
- project: 'vr-group/unreal-development/unreal-ci' | ||
ref: master | ||
file: '/shared_scripts.yml' | ||
|
||
# In this file you are able to configure your plugins pipeline. | ||
# If you want to customize something, either overwrite things that are defined in the shared_scripts repository, | ||
# or remove the "extends" and write your own scripts | ||
# | ||
# If you want your pipeline to run on every commit, just remove the "only" blocks. Keep in mind, that a build | ||
# can take some time. | ||
# | ||
# If you want to alter the unreal-building process two variables are defined for either changing the CLIENT_CONFIG or | ||
# for adding EXTRA_ARGS to the building process | ||
# | ||
# For the generate stage, you can specify needed dependencies in GEN_DEPENDENCIES with [Branch@PluginFolder] as key | ||
# Example: | ||
# | ||
# Generate_Project: | ||
# only: ['web', 'schedules'] | ||
# extends: .Generate_Project_ | ||
# variables: | ||
# GEN_TEMPLATE_REPO: "https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unrealprojecttemplate.git" | ||
# GEN_TEMPLATE_BRANCH: "develop" | ||
# GEN_DEPENDENCIES: "( | ||
# [master@nDisplayExtensions]='https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/ndisplayextensions.git' | ||
# [master@CaveOverlay]='https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unreal-cave-overlay.git' | ||
# )" | ||
# | ||
# You can uncomment the deploy lines to deploy your project to the CAVE/VRDev. This only makes sense, if your plugin works | ||
# with a generated project. | ||
|
||
stages: | ||
- generate | ||
- build | ||
# - deploy | ||
|
||
Generate_Project: | ||
only: ['web', 'schedules'] | ||
extends: .Generate_Project_ | ||
variables: | ||
GEN_TEMPLATE_REPO: "https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/unrealprojecttemplate.git" | ||
GEN_TEMPLATE_BRANCH: "4.26" | ||
GEN_DEPENDENCIES: "( | ||
)" | ||
|
||
Build_Windows: | ||
only: ['web', 'schedules'] | ||
extends: .Build_Windows_ | ||
tags: | ||
- windows | ||
- unreal-4.26 | ||
variables: | ||
GIT_STRATEGY: none | ||
GIT_CHECKOUT: "false" | ||
CLIENT_CONFIG: "DebugGame" | ||
needs: | ||
- job: "Generate_Project" | ||
artifacts: true | ||
|
||
Build_CentOS: | ||
only: ['web', 'schedules'] | ||
extends: .Build_CentOS_ | ||
tags: | ||
- centos | ||
- unreal-4.26 | ||
variables: | ||
GIT_STRATEGY: none | ||
GIT_CHECKOUT: "false" | ||
CLIENT_CONFIG: "DebugGame" | ||
needs: | ||
- job: "Generate_Project" | ||
artifacts: true | ||
|
||
#Deploy_CAVE: | ||
# only: ['web', 'schedules'] | ||
# extends: .Deploy_CAVE_ | ||
# needs: | ||
# - job: "Build_CentOS" | ||
# artifacts: true | ||
# | ||
#Deploy_Windows: | ||
# only: ['web', 'schedules'] | ||
# extends: .Deploy_VRDev_ | ||
# needs: | ||
# - job: "Build_Windows" | ||
# artifacts: true |
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,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2020, Virtual Reality & Immersive Visualization Group at RWTH Aachen University | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "LogFileManager.h" | ||
|
||
LogFileStream* LogFileManager::GetLogFileStream(FString FilePath, FString FileName) | ||
{ | ||
FString Full_Path = FPaths::Combine(FilePath, FileName); | ||
if (Streams.Contains(Full_Path)) | ||
return Streams[Full_Path].Get(); | ||
else | ||
Streams.Add(Full_Path, MakeUnique<LogFileStream>(FilePath, FileName)); | ||
return Streams[Full_Path].Get(); | ||
} | ||
|
||
LogFileManager::LogFileManager() | ||
{ | ||
} | ||
|
||
LogFileManager::~LogFileManager() | ||
{ | ||
} |
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,17 @@ | ||
#pragma once | ||
|
||
#include "LogFileStream.h" | ||
|
||
class LogFileManager | ||
{ | ||
public: | ||
LogFileStream* GetLogFileStream(FString FilePath, FString FileName); | ||
|
||
private: | ||
friend class UniversalLoggingImpl; | ||
LogFileManager(); | ||
virtual ~LogFileManager(); | ||
|
||
private: | ||
TMap<FString, TUniquePtr<LogFileStream>> Streams; | ||
}; |
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,53 @@ | ||
#include "LogFileStream.h" | ||
|
||
#include "HAL/PlatformFilemanager.h" | ||
#include "LogStream.h" | ||
#include "Misc/Paths.h" | ||
|
||
LogFileStream::LogFileStream(const FString Filepath, const FString Filename) | ||
: Filepath(Filepath) | ||
, Filename(Filename) | ||
, bIs_Open(false) | ||
, File_Handle(nullptr) | ||
{ | ||
} | ||
|
||
LogFileStream::~LogFileStream() | ||
{ | ||
Close(); | ||
} | ||
|
||
void LogFileStream::Open() | ||
{ | ||
IPlatformFile& platform_file = FPlatformFileManager::Get().GetPlatformFile(); | ||
FString file_path = FPaths::ConvertRelativePathToFull(FPaths::ProjectDir() + Filepath); | ||
platform_file.CreateDirectoryTree(*file_path); | ||
file_path = FPaths::Combine(file_path, Filename); | ||
File_Handle.Reset(platform_file.OpenWrite(*file_path)); | ||
if (!File_Handle) | ||
{ | ||
UE_LOG(LogUni, Error, TEXT("Universal Logging: The file %s could not be opened for writing."), *file_path); | ||
bIs_Open = false; | ||
return; | ||
} | ||
bIs_Open = true; | ||
} | ||
|
||
void LogFileStream::Close() | ||
{ | ||
File_Handle.Reset(); | ||
bIs_Open = false; | ||
} | ||
|
||
bool LogFileStream::GetIsOpen() const | ||
{ | ||
return bIs_Open; | ||
} | ||
|
||
void LogFileStream::Write(const FString Text) | ||
{ | ||
if (!bIs_Open) | ||
Open(); | ||
const FTCHARToUTF8 StringUTF8(*Text); | ||
File_Handle->Write(reinterpret_cast<const uint8*>(StringUTF8.Get()), StringUTF8.Length()); | ||
} |
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,19 @@ | ||
#pragma once | ||
|
||
class LogFileStream | ||
{ | ||
public: | ||
LogFileStream(const FString Filepath, const FString Filename); | ||
virtual ~LogFileStream(); | ||
|
||
void Open(); | ||
void Close(); | ||
bool GetIsOpen() const; | ||
void Write(const FString Text); | ||
|
||
private: | ||
const FString Filepath; | ||
const FString Filename; | ||
bool bIs_Open; | ||
TUniquePtr <IFileHandle> File_Handle; | ||
}; |
Oops, something went wrong.