This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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
7 changed files
with
132 additions
and
101 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
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,57 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
throwConfigExceptions="true"> | ||
<time xsi:type="FastUTC" /> | ||
|
||
<variable name="dateFormat" value="dd.MM.yyyy-hh.mm.ss" /> | ||
<variable name="startTime" value="${cached:cached=true:inner=${date:format=${dateFormat}}}" /> | ||
|
||
<variable name="serverName" value="SERVER" /> | ||
<variable name="playerLogger" | ||
value="${logger:whenEmpty=${serverName}}" /> | ||
<variable name="chatTo" | ||
value="${when:when='${event-properties:whisper}' == true:inner= to ${event-properties:to:whenEmpty=${serverName}}}" /> | ||
|
||
<variable name="defaultLayout" value="(${longdate}) ${level:uppercase=true} in ${logger}\: ${message}" /> | ||
<variable name="playerActionLayout" value="(${longdate}) ACTION by ${playerLogger}\: ${message}" /> | ||
<variable name="chatLayout" value="(${longdate}) [${playerLogger}${chatTo}] ${message}" /> | ||
|
||
<variable name="layoutName" value="${event-properties:layout}" /> | ||
|
||
<!--ugliest shit i've ever written--> | ||
<variable name="autoLayout1" | ||
value="${when:when='${layoutName}' == 'chat':inner=${chatLayout}:else=${defaultLayout}}" /> | ||
<variable name="autoLayout0" | ||
value="${when:when='${layoutName}' == 'playerAction':inner=${playerActionLayout}:else=${autoLayout1}}" /> | ||
<variable name="autoLayout" | ||
value="${autoLayout0}" /> | ||
|
||
<targets> | ||
<target name="debugger" xsi:type="Debugger" layout="${autoLayout}" /> | ||
<target name="console" xsi:type="ColoredConsole" layout="${autoLayout}" useDefaultRowHighlightingRules="false"> | ||
<highlight-row condition="'${event-properties:layout}' == 'playerAction'" foregroundColor="Cyan" /> | ||
<highlight-row condition="'${event-properties:success}' == true" foregroundColor="Green" /> | ||
<highlight-row condition="'${event-properties:progress}' == true" foregroundColor="DarkGreen" /> | ||
<highlight-row condition="'${event-properties:progressStart}' == true" foregroundColor="DarkGray" /> | ||
<highlight-row condition="'${event-properties:unhandled}' == true" foregroundColor="DarkGray" /> | ||
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="DarkRed" /> | ||
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" /> | ||
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" /> | ||
<highlight-row condition="level == LogLevel.Info" foregroundColor="White" /> | ||
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" /> | ||
<highlight-row condition="level == LogLevel.Trace" foregroundColor="DarkGray" /> | ||
</target> | ||
<target name="file" xsi:type="File" fileName="${currentdir}\logs\latest.log" | ||
header="This CaO Server (v${assembly-version}) log has started at ${startTime} on ${machinename}" | ||
layout="${autoLayout}" maxArchiveFiles="10" archiveNumbering="DateAndSequence" | ||
archiveDateFormat="${dateFormat}" archiveFileName="${currentdir}\logs\{#}.log" archiveEvery="None" | ||
archiveOldFileOnStartup="true" /> | ||
</targets> | ||
|
||
<rules> | ||
<logger name="*" minlevel="Trace" writeTo="debugger" /> | ||
<logger name="*" minlevel="Trace" writeTo="console" /> | ||
<logger name="*" minlevel="Info" writeTo="file" /> | ||
</rules> | ||
</nlog> |
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
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.