本文整理汇总了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;