本文整理汇总了C#中VLogger类的典型用法代码示例。如果您正苦于以下问题:C# VLogger类的具体用法?C# VLogger怎么用?C# VLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VLogger类属于命名空间,在下文中一共展示了VLogger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConfigUpdater
public ConfigUpdater(Configuration config, VLogger log, int frequency, Delegate method, Platform platform)
{
this.config = config;
this.logger = log;
this.frequency = frequency;
this.methodToInvoke = method;
this.platform = platform;
tcb = ConfigSync;
timer = new Timer(tcb, null, 500, frequency);
if (System.IO.Directory.Exists(temporaryZipLocation)) // creating temporary directory location for downloading and holding zips
Utils.CleanDirectory(logger, temporaryZipLocation);
Utils.CreateDirectory(logger, temporaryZipLocation);
this.status = new UpdateStatus(this.frequency);
ConfigUpdaterWebService webService = new ConfigUpdaterWebService(logger, this);
string homeIdPart = "";
if (!string.IsNullOrWhiteSpace(Settings.HomeId))
homeIdPart = "/" + Settings.HomeId;
string url = Constants.InfoServiceAddress + homeIdPart + "/config";
serviceHost = ConfigUpdaterWebService.CreateServiceHost(webService, new Uri(url));
serviceHost.Open();
Utils.structuredLog(logger, "I", "ConfigUpdaterWebService initiated at " + url);
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:29,代码来源:ConfigUpdater.cs
示例2: HeartbeatService
public HeartbeatService(Platform platform, VLogger log)
{
this.platform = platform;
this.logger = log;
this.tcb = SendHeartbeat;
this.sequenceNumber = 0;
try
{
this.uri = new Uri("https://" + GetHeartbeatServiceHostString() + ":" + Constants.HeartbeatServiceSecurePort + "/" +
Constants.HeartbeatServiceWcfListenerEndPointUrlSuffix);
this.heartbeatIntervalMins = Settings.HeartbeatIntervalMins;
if (this.heartbeatIntervalMins < Constants.MinHeartbeatIntervalInMins)
this.heartbeatIntervalMins = Constants.MinHeartbeatIntervalInMins;
if (this.heartbeatIntervalMins > Constants.MaxHeartbeatIntervalInMins)
this.heartbeatIntervalMins = Constants.MaxHeartbeatIntervalInMins;
this.perfCountPercentProcTime = new PerformanceCounter("Process", "% Processor Time", Process.GetCurrentProcess().ProcessName, true);
this.perfCountWorkingSet = new PerformanceCounter("Process", "Working Set", Process.GetCurrentProcess().ProcessName, true);
}
catch (Exception e)
{
logger.Log("Platform failed failed to construct heartbeat service , Exception={0}", e.Message);
}
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:25,代码来源:HeartbeatService.cs
示例3: AuthenticationService
public AuthenticationService(VLogger logger, AuthSvcViewOfPlatform platform)
{
this.logger = logger;
this.platform = platform;
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:7,代码来源:AuthenticationService.cs
示例4: SafeServiceHost
public SafeServiceHost(VLogger logger, Type contractType, SafeServicePolicyDecider consumer, string webAddressSuffix, params string[] addresses)
{
object instance = consumer;
this.policyDecider = consumer;
this.logger = logger;
List<Uri> addressList = new List<Uri>();
foreach (String address in addresses)
{
addressList.Add(new Uri(address+webAddressSuffix));
}
serviceHost = new ServiceHost(instance, addressList.ToArray());
serviceHost.Authentication.ServiceAuthenticationManager = new SafeServiceAuthenticationManager();
serviceHost.Authorization.ServiceAuthorizationManager = new SafeServiceAuthorizationManager(consumer, this);
foreach (string address in addresses)
{
var contract = ContractDescription.GetContract(contractType);
var webBinding = new WebHttpBinding();
var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(address+webAddressSuffix));
webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior());
serviceHost.AddServiceEndpoint(webEndPoint);
}
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:25,代码来源:SafeServiceHost.cs
示例5: EmailerBase
protected EmailerBase(string smtpServer, string smtpUsername, string smtpPassword, VLogger logger)
{
this.smtpServer = smtpServer;
this.smtpUsername = smtpUsername;
this.smtpPassword = smtpPassword;
this.logger = logger;
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:7,代码来源:Emailer.cs
示例6: InfoService
public InfoService (Platform platform, VLogger logger)
{
this.platform = platform;
this.logger = logger;
string homeIdPart = string.Empty;
//if (HomeOS.Shared.Globals.HomeId != null)
//{
// homeIdPart = "/" + HomeOS.Shared.Globals.HomeId;
//}
host = new ServiceHost(this, new Uri(HomeOS.Hub.Common.Constants.InfoServiceAddress + homeIdPart));
host.AddServiceEndpoint(typeof(IHomeOSInfo), new WebHttpBinding(), "").Behaviors.Add(new System.ServiceModel.Description.WebHttpBehavior());
var smb = new System.ServiceModel.Description.ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
host.Description.Behaviors.Add(smb);
try
{
host.Open();
}
catch (Exception e)
{
logger.Log("Could not open the service host: " + e.Message + @"
Possible issues: 1) are you running the command prompt / Visual Studio in administrator mode?
2) is another instance of Platform running?
3) is a local copy of Gatekeeper running?
4) is another process occupying the InfoServicePort (51430)?");
throw e;
}
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:34,代码来源:InfoService.cs
示例7: GetHomeOSUpdateVersion
public static string GetHomeOSUpdateVersion(string configFile, VLogger logger)
{
string homeosUpdateVersion = Constants.UnknownHomeOSUpdateVersionValue;
try
{
XElement xmlTree = XElement.Load(configFile);
IEnumerable<XElement> das =
from el in xmlTree.DescendantsAndSelf()
where el.Name == "add" && el.Parent.Name == "appSettings" && el.Attribute("key").Value == Constants.ConfigAppSettingKeyHomeOSUpdateVersion
select el;
if (das.Count() > 0)
{
homeosUpdateVersion = das.First().Attribute("value").Value;
}
}
catch (Exception e)
{
if (e is DirectoryNotFoundException || e is FileNotFoundException)
{
if (logger != null)
logger.Log("Warning: File not found: " + configFile);
}
else
{
if (logger != null)
logger.Log(String.Format("GetHomeOSUpdateVersion call failed: Cannot parse {0}. {1}", configFile, "The vervsion is not returned"));
}
}
return homeosUpdateVersion;
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:30,代码来源:Utils.cs
示例8: DiscoveryHelper
public DiscoveryHelper(Platform platform, VLogger logger)
{
this.platform = platform;
this.logger = logger;
listener = new UdpClient(new IPEndPoint(IPAddress.Any, Common.Constants.PlatformDiscoveryPort));
BeginReceive();
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:9,代码来源:DiscoveryHelper.cs
示例9: Init
public void Init(string baseUrl, string baseDir, ScoutViewOfPlatform platform, VLogger logger) {
this.baseUrl = baseUrl;
this.platform = platform;
this.logger = logger;
scoutService = new BluetoothScoutService(baseUrl + "/webapp", this, platform, logger);
appServer = new WebFileServer(baseDir, baseUrl, logger);
logger.Log("BluetoothScout initialized.");
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:11,代码来源:BluetoothScout.cs
示例10: V2C
internal static ILogger V2C(VLogger view)
{
if (!System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain(view) &&
(view.GetType().Equals(typeof(LoggerC2V))))
{
return ((LoggerC2V)(view)).GetSourceContract();
}
else
{
return new LoggerV2C(view);
}
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:12,代码来源:ALogger.cs
示例11: Init
public void Init(string baseUrl, string baseDir, ScoutViewOfPlatform platform, VLogger logger)
{
this.baseUrl = baseUrl;
this.platform = platform;
this.logger = logger;
scoutService = new SynapseWirelessScoutService(baseUrl + "/webapp", this, logger);
appServer = new WebFileServer(baseDir, baseUrl, logger);
startSynapseController();
logger.Log("SynapseWirelessScout initialized");
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:14,代码来源:SynapseWirelessScout.cs
示例12: WebFileServer
public WebFileServer(string directory, string baseUrl, VLogger logger)
{
this.logger = logger;
this.directory = directory;
this.host = new ServiceHost(this, new Uri(baseUrl));
this.host.AddServiceEndpoint(typeof(IWebFileServer), new WebHttpBinding(), "").Behaviors.Add(new System.ServiceModel.Description.WebHttpBehavior());
var smb = new System.ServiceModel.Description.ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
this.host.Description.Behaviors.Add(smb);
this.host.Open();
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:14,代码来源:WebFileServer.cs
示例13: CreateServiceHost
public static ServiceHost CreateServiceHost(VLogger logger, VPlatform platform, IAuthenticationService instance)
{
string homeIdPart = string.Empty, homeId = platform.GetConfSetting("HomeId");
if (!string.IsNullOrEmpty(homeId))
homeIdPart = "/" + homeId;
ServiceHost serviceHost = new ServiceHost(instance, new Uri(Constants.InfoServiceAddress + homeIdPart + "/" + authEndpoint));
var contract = ContractDescription.GetContract(typeof(IAuthenticationService));
var webBinding = new WebHttpBinding();
var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(new Uri(Constants.InfoServiceAddress + homeIdPart + "/" + authEndpoint)));
webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior());
serviceHost.AddServiceEndpoint(webEndPoint);
return serviceHost;
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:14,代码来源:AuthenticationService.cs
示例14: GuiService
public GuiService(Platform platform, Configuration config, HomeStoreInfo hsInfo, VLogger logger)
{
this.platform = platform;
this.config = config;
this.homeStoreInfo = hsInfo;
this.logger = logger;
string svcBase = Common.Constants.InfoServiceAddress + "/" ;
//let us start serving the files
string webBase = svcBase + Common.Constants.GuiServiceSuffixWeb;
webFileServer = new WebFileServer(Common.Constants.DashboardRoot, webBase, logger);
serviceHostWeb = OpenUnsafeServiceWeb(webBase + Common.Constants.AjaxSuffix);
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:15,代码来源:GuiService.cs
示例15: CreateServiceHost
public static SafeServiceHost CreateServiceHost(VLogger logger, ModuleBase moduleBase, ISimplexValveControllerNotifierContract instance,
string address)
{
SafeServiceHost service = new SafeServiceHost(logger, moduleBase, instance, address);
var contract = ContractDescription.GetContract(typeof(ISimplexValveControllerNotifierContract));
var webBinding = new WebHttpBinding();
var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(service.BaseAddresses()[0]));
webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior());
service.AddServiceEndpoint(webEndPoint);
service.AddServiceMetadataBehavior(new ServiceMetadataBehavior());
return service;
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:17,代码来源:AppValveControllerSvc.cs
示例16: DoLeaseOperation
public static void DoLeaseOperation(VLogger logger, CloudBlob blob, string leaseId, LeaseAction action, int AzureBlobLeaseTimeout)
{
try
{
if (blob == null || leaseId == null)
return;
var creds = blob.ServiceClient.Credentials;
var transformedUri = new Uri(creds.TransformUri(blob.Uri.ToString()));
var req = BlobRequest.Lease(transformedUri, AzureBlobLeaseTimeout, action, leaseId);
creds.SignRequest(req);
req.GetResponse().Close();
}
catch (WebException e)
{
Utils.structuredLog(logger, "WebException", e.Message + ". DoLeaseOperation, blob: " + blob.Name + ", leaseId: " + leaseId + ", action " + action);
}
}
开发者ID:smosgin,项目名称:labofthings,代码行数:17,代码来源:AzureUtils.cs
示例17: Init
public void Init(string baseUrl, string baseDir, ScoutViewOfPlatform platform, VLogger logger)
{
this.baseUrl = baseUrl;
this.platform = platform;
this.logger = logger;
scoutService = new AxisCamScoutService(baseUrl + "/webapp", this, logger);
appServer = new WebFileServer(baseDir, baseUrl, logger);
logger.Log("AxisCamScout initialized");
//create a time that fires ScanNow() periodically
var scanTimer = new System.Timers.Timer(ScoutHelper.DefaultDeviceDiscoveryPeriodSec * 1000);
scanTimer.Enabled = true;
scanTimer.Elapsed += new System.Timers.ElapsedEventHandler(ScanNow);
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:17,代码来源:AxisCamScout.cs
示例18: BluetoothScoutService
public BluetoothScoutService(string baseAddress, BluetoothScout btScout, ScoutViewOfPlatform platform, VLogger logger)
{
this.logger = logger;
this.bluetoothScout = btScout;
service = new SafeServiceHost(logger, platform, this, baseAddress);
var contract = ContractDescription.GetContract(typeof(IBluetoothScoutContract));
var webBinding = new WebHttpBinding();
var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(baseAddress));
webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior());
service.AddServiceEndpoint(webEndPoint);
service.AddServiceMetadataBehavior(new ServiceMetadataBehavior());
service.Open();
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:18,代码来源:BluetoothScoutSvc.cs
示例19: Init
public void Init(string baseUrl, string baseDir, ScoutViewOfPlatform platform, VLogger logger)
{
this.baseUrl = baseUrl;
this.platform = platform;
this.logger = logger;
scoutService = new OwmScoutService(baseUrl + "/webapp", this, platform, logger);
appServer = new WebFileServer(baseDir, baseUrl, logger);
//initialize the device we'll use
device = new Device("OpenWeatherMap", UniqueDeviceId(), "", DateTime.Now, "HomeOS.Hub.Drivers.OpenWeatherMap");
// the parameters are: uniqueName, appid, lattitude, longitude
device.Details.DriverParams = new List<string>() { device.UniqueName, DefaultAppId, "", "" };
logger.Log("DummyScout initialized");
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:18,代码来源:OwmScout.cs
示例20: Init
public static void Init(VLogger loggerObject)
{
lock (lockObject)
{
if (instance != null)
loggerObject.Log("Duplicate Init called on ScoutHelper");
instance = new object();
}
logger = loggerObject;
//create a time that fires ScanNow() periodically
upnpScanTimer = new Timer(ScoutHelper.DefaultDeviceDiscoveryPeriodSec * 1000);
//upnpScanTimer = new Timer(1 * 1000); // for debugging
upnpScanTimer.Enabled = true;
upnpScanTimer.Elapsed += new ElapsedEventHandler(UpnpScan);
}
开发者ID:donnaknew,项目名称:programmingProject,代码行数:18,代码来源:ScoutHelper.cs
注:本文中的VLogger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论