mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-09-24 03:36:34 +00:00
0eccd8a58c
* trying to add header file to all .cs files * revert the logo back to original * cleanup icon use * attempt to placate adv installer * add generated imgs from adv installer too... * update images from installer again * updates to readmes * update sln too * update latest to 2.2.1.6 * updates to advinst * use the proper version * add version file to the .sln * minor tweaks to build script when using local built stuffs * push adv inst versoin * fix adv installer registration * use &() to execute the string * no need to write it to a file * too many hyphens * i do so love debugging github actions * remove local-build and ziti-edge-tunnel build and wintun.zip (#641) * update tsdk/csdk to 0.22.23 / 0.36.6 (#642) * update tsdk/csdk to 0.22.23 / 0.36.6 * use ZITI_EDGE_TUNNEL_VERSION if env:ZITI_EDGE_TUNNEL_BUILD is not set * get tsdk 0.22.24 (#643) * get tsdk 0.22.24 * update advanced installer * set version to 2.2.2 (#644) --------- Co-authored-by: Shawn Carey <shawn.carey@netfoundry.io>
49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
/*
|
|
Copyright NetFoundry Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
using NLog;
|
|
|
|
namespace Ziti.Desktop.Edge.Utils {
|
|
public class UIUtils {
|
|
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public static void SetLogLevel(string level) {
|
|
try
|
|
{
|
|
Logger.Info("request to change log level received: {0}", level);
|
|
if ((""+level).ToLower() == "verbose") {
|
|
level = "trace";
|
|
Logger.Info("request to change log level to verbose - but using trace instead");
|
|
}
|
|
var l = LogLevel.FromString(level);
|
|
foreach (var rule in LogManager.Configuration.LoggingRules) {
|
|
rule.EnableLoggingForLevel(l);
|
|
rule.SetLoggingLevels(l, LogLevel.Fatal);
|
|
}
|
|
|
|
LogManager.ReconfigExistingLoggers();
|
|
Logger.Info("logger reconfigured to log at level: {0}", l);
|
|
} catch (Exception e) {
|
|
Logger.Error(e, "Failed to set log level: {0}", e.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|