Skip to content

Commit 2956bcd

Browse files
committed
setup default forecolor in HTML log
1 parent 72b6b6e commit 2956bcd

5 files changed

Lines changed: 55 additions & 5 deletions

File tree

Console/CompuMaster.Console.vbproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<Product>CompuMaster.Console</Product>
88
<Copyright>2016-2017,2019,2021,2022 CompuMaster GmbH</Copyright>
99
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
10-
<AssemblyVersion>2022.7.22.101</AssemblyVersion>
11-
<Version>2022.7.22.101</Version>
10+
<AssemblyVersion>2022.7.22.102</AssemblyVersion>
11+
<Version>2022.7.22.102</Version>
1212
<VBRuntime>Embed</VBRuntime>
1313
<IsPackable>true</IsPackable>
1414
<Configurations>Debug;Release;CI_CD</Configurations>

Console/Console.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ Namespace CompuMaster
12611261
If headContent <> Nothing Then
12621262
FileContent.Append("<head>" & headContent & "</head>" & System.Environment.NewLine)
12631263
End If
1264-
FileContent.Append("<body style=""background-color: " & BackColorname & ";"">" & System.Environment.NewLine)
1264+
FileContent.Append("<body style=""background-color: " & BackColorname & "; color: " & ForeColorname & ";"">" & System.Environment.NewLine)
12651265
FileContent.Append(bodyPreContent)
12661266
FileContent.Append("<span style=""color: " & ForeColorname & ";"">" + log.ToString + "</span>" & System.Environment.NewLine)
12671267
FileContent.Append(bodyPostContent)

ConsoleDebug/ConsoleDebug.vbproj

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
5-
<GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
6-
<GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
5+
<GenerateResourceMSBuildArchitecture>CurrentArchitecture</GenerateResourceMSBuildArchitecture>
6+
<GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
77
</PropertyGroup>
88
<PropertyGroup>
99
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -52,14 +52,38 @@
5252
<OptionInfer>On</OptionInfer>
5353
</PropertyGroup>
5454
<ItemGroup>
55+
<Reference Include="CompuMaster.Data, Version=3.0.2022.610, Culture=neutral, processorArchitecture=MSIL">
56+
<HintPath>..\packages\CompuMaster.Data.3.0.2022.610\lib\net461\CompuMaster.Data.dll</HintPath>
57+
</Reference>
5558
<Reference Include="System" />
59+
<Reference Include="System.Configuration" />
5660
<Reference Include="System.Data" />
61+
<Reference Include="System.Data.OracleClient" />
5762
<Reference Include="System.Deployment" />
63+
<Reference Include="System.DirectoryServices" />
64+
<Reference Include="System.IO.FileSystem.AccessControl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
65+
<HintPath>..\packages\System.IO.FileSystem.AccessControl.5.0.0\lib\net461\System.IO.FileSystem.AccessControl.dll</HintPath>
66+
</Reference>
67+
<Reference Include="System.Net" />
68+
<Reference Include="System.Security" />
69+
<Reference Include="System.Security.AccessControl, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
70+
<HintPath>..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
71+
</Reference>
72+
<Reference Include="System.Security.Permissions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
73+
<HintPath>..\packages\System.Security.Permissions.6.0.0\lib\net461\System.Security.Permissions.dll</HintPath>
74+
</Reference>
75+
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
76+
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
77+
</Reference>
78+
<Reference Include="System.ServiceProcess" />
79+
<Reference Include="System.Transactions" />
80+
<Reference Include="System.Web" />
5881
<Reference Include="System.Xml" />
5982
<Reference Include="System.Core" />
6083
<Reference Include="System.Xml.Linq" />
6184
<Reference Include="System.Data.DataSetExtensions" />
6285
<Reference Include="System.Net.Http" />
86+
<Reference Include="WindowsBase" />
6387
</ItemGroup>
6488
<ItemGroup>
6589
<Import Include="Microsoft.VisualBasic" />
@@ -109,6 +133,7 @@
109133
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
110134
</None>
111135
<None Include="App.config" />
136+
<None Include="packages.config" />
112137
</ItemGroup>
113138
<ItemGroup>
114139
<ProjectReference Include="..\Console\CompuMaster.Console.vbproj">

ConsoleDebug/Module1.vb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@
2929
CompuMaster.Console.WriteLine()
3030
CompuMaster.Console.CurrentIndentationLevel = 0
3131

32+
CompuMaster.Console.WriteDual("Now, let's write plain text tables to console + plaint text log, but write nicely formatted table to HTML log" & System.Environment.NewLine,
33+
"<h2>Now, let's write plain text tables to console + plaint text log, but write nicely formatted table to HTML log</h2>")
34+
Dim DemoTable As DataTable = CompuMaster.Data.Csv.ReadDataTableFromCsvString("Key,Description,DemoData" & ControlChars.CrLf &
35+
"Row 1,Hello world!,You'll see nicely formatted plain text at console and plain text log" & ControlChars.CrLf &
36+
"Row 2,Great news!,This table will be formatted very nicely at HTML log", True, ","c, """"c, False, True)
37+
DemoTable.TableName = "Pretty demo table"
38+
CompuMaster.Console.LogDual("",
39+
"<style>" & ControlChars.CrLf &
40+
" tbody tr:nth-child(odd){background-color: #3c3c3c;}; " & ControlChars.CrLf &
41+
" tbody td{padding: 30px;}" & ControlChars.CrLf &
42+
"</style>")
43+
CompuMaster.Console.WriteLineDual(CompuMaster.Data.DataTables.ConvertToPlainTextTableFixedColumnWidths(DemoTable),
44+
CompuMaster.Data.DataTables.ConvertToHtmlTable(DemoTable, "<h3>", "</h3>", "style=""width: 100%"""))
45+
CompuMaster.Console.WriteLineDual()
46+
47+
3248
CompuMaster.Console.OkayLine("OKAY: This nice sample has completed!")
3349

3450
'Write log to disk

ConsoleDebug/packages.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="CompuMaster.Data" version="3.0.2022.610" targetFramework="net462" />
4+
<package id="System.DirectoryServices" version="6.0.0" targetFramework="net462" />
5+
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net462" />
6+
<package id="System.Security.AccessControl" version="6.0.0" targetFramework="net462" />
7+
<package id="System.Security.Permissions" version="6.0.0" targetFramework="net462" />
8+
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
9+
</packages>

0 commit comments

Comments
 (0)