From 7bbd95b113530be7cf94366ce770e99167d4f425 Mon Sep 17 00:00:00 2001 From: darthsharp <48331467+darthsharp@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:09:48 +0200 Subject: [PATCH] Redirect log output to stderr and register new SmartMeter data producer in Linux server startup. --- install-smartmeter.sh | 2 +- source/CreativeCoders.SmartMeter.Server.Linux/Program.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/install-smartmeter.sh b/install-smartmeter.sh index f195481..0c43b9f 100755 --- a/install-smartmeter.sh +++ b/install-smartmeter.sh @@ -46,7 +46,7 @@ Requires: curl, tar, jq, sudo (and gh authenticated when --workflows is used). EOF } -log() { printf '%s\n' "$*"; } +log() { printf '%s\n' "$*" >&2; } warn() { printf 'WARN: %s\n' "$*" >&2; } err() { printf 'ERROR: %s\n' "$*" >&2; } diff --git a/source/CreativeCoders.SmartMeter.Server.Linux/Program.cs b/source/CreativeCoders.SmartMeter.Server.Linux/Program.cs index 9595946..370ef98 100644 --- a/source/CreativeCoders.SmartMeter.Server.Linux/Program.cs +++ b/source/CreativeCoders.SmartMeter.Server.Linux/Program.cs @@ -1,4 +1,6 @@ using CreativeCoders.Daemon.Linux; +using CreativeCoders.SmartMeter.Core; +using CreativeCoders.SmartMeter.Core.SmlData; using CreativeCoders.SmartMeter.DataProcessing; using CreativeCoders.SmartMeter.Server.Core; using Microsoft.Extensions.Configuration; @@ -13,10 +15,12 @@ await SmartMeterDaemonHostBuilder.CreateSmartMeterDaemonHostBuilder(args) var config = services.BuildServiceProvider().GetRequiredService(); services.Configure(config.GetSection("Mqtt")); + + services.AddSingleton(); + services.AddSmartMeterServer(); }) .WithDefinitionFile("daemon.json") .UseSystemd() .Build() .RunAsync() .ConfigureAwait(false); - \ No newline at end of file