本文整理匯總了TypeScript中node-opcua-debug.checkDebugFlag函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript checkDebugFlag函數的具體用法?TypeScript checkDebugFlag怎麽用?TypeScript checkDebugFlag使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了checkDebugFlag函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: make_debugLog
import { ExtensionObject } from "node-opcua-extension-object";
import { EventFilter } from "node-opcua-service-filter";
import { ReadValueId, ReadValueIdOptions } from "node-opcua-service-read";
import {
MonitoredItemCreateResult,
MonitoringMode, MonitoringParameters, MonitoringParametersOptions
} from "node-opcua-service-subscription";
import { StatusCode, StatusCodes } from "node-opcua-status-code";
import { Variant } from "node-opcua-variant";
import { ClientMonitoredItemBase } from "../client_monitored_item_base";
import { ClientSubscription } from "../client_subscription";
import { ClientSubscriptionImpl } from "./client_subscription_impl";
const debugLog = make_debugLog(__filename);
const doDebug = checkDebugFlag(__filename);
export type PrepareForMonitoringResult = { error: string } | {
error?: null;
itemToMonitor: ReadValueIdOptions;
monitoringMode: MonitoringMode;
requestedParameters: MonitoringParameters;
};
export class ClientMonitoredItemBaseImpl extends EventEmitter implements ClientMonitoredItemBase {
public itemToMonitor: ReadValueId;
public monitoringParameters: MonitoringParameters;
public subscription: ClientSubscriptionImpl;
public monitoringMode: MonitoringMode;
public statusCode: StatusCode;
示例2: make_debugLog
import { StatusCodes } from "node-opcua-status-code";
import { CallMethodResultOptions } from "node-opcua-types";
import { DataType, Variant, VariantArrayType } from "node-opcua-variant";
import { ByteString, UAString } from "node-opcua-basic-types";
import { CreateSigningRequestResult, PushCertificateManager } from "./push_certificate_manager";
import {
installCertificateExpirationAlarm
} from "./server/install_CertificateAlarm";
import {
PushCertificateManagerServerImpl,
PushCertificateManagerServerOptions
} from "./server/push_certificate_manager_server_impl";
const debugLog = make_debugLog("ServerConfiguration");
const doDebug = checkDebugFlag("ServerConfiguration");
const errorLog = debugLog;
function hasExpectedUserAccess(context: SessionContext) {
if (!context ||
!context.session ||
!context.session.userIdentityToken) {
return false;
}
const currentUserRole = context.getCurrentUserRole();
return !!currentUserRole.match("SecurityAdmin");
}
function hasEncryptedChannel(context: SessionContext) {
// todo
return true;