带leve 信息输出
直接上代码
#include <stdio.h>
#include <stdarg.h>
#define Error 0
#define Warning 1
#define Debug 2
#define Info 3
#define NOW Debug
int gErrorMsg(char* fmt,...){
va_list vl;
va_start(vl,fmt);
if(NOW <= Error){
printf("[Error]");
vfprintf( stdout, fmt, vl );
printf("\n");
}
va_end(vl);
}
int gWarningMsg(char* fmt,...){
va_list vl;
va_start(vl,fmt);
if(NOW <= Warning){
printf("[Warning]");
vfprintf( stdout, fmt, vl );
printf("\n");
}
va_end(vl);
}
int gDebugMsg(char* fmt,...){
va_list vl;
va_start(vl,fmt);
if(NOW <= Debug){
printf("[Debug]");
vfprintf( stdout, fmt, vl );
printf("\n");
}
va_end(vl);
}
int gInfoMsg(char* fmt,...){
va_list vl;
va_start(vl,fmt);
if(NOW <= Info){
printf("[Info]");
vfprintf( stdout, fmt, vl );
printf("\n");
}
va_end(vl);
}
int main(){
gErrorMsg("%s", "Hello eMessage!");
gWarningMsg("%s", "Hello eMessage!");
gDebugMsg("%s", "Hello eMessage!");
gInfoMsg("%s", "Hello eMessage!");
return 0;
}
如此 消息级别可控 其只会输出 >= 目标级别 的信息 而且目标级别可调 而不需改动代码
运行结果:
Administrator@g-laptop /cygdrive/e/cprogramming/cpp/gMessage
$ ./test
[Debug]Hello eMessage!
[Info]Hello eMessage!
分享到:
相关推荐
ADC to line level output with 0dB gain, SNR >= 100dBA, THD+N Stereo/Mono BTL (Bridge-Tied-Load) Class-D amplifier 650mW/CH (SPKVDD=3.6V, THD+N , 8 Load) 500mW/CH (SPKVDD=3.6V, THD+N ,...
Contents Preface xi Acknowledgements xiii Abbreviations xv 1 Introduction 1 ...11.2.6 Maximum input level 237 11.3 Frequency bands and multiband terminals 239 11.4 References 240 Index 241
1. **高功率输出**: 该研究实现了单个VCSEL阵列(包含163个器件)在30 ns脉冲工作模式下达到25.5 W的峰值输出功率。 2. **低驱动电流**: 在保持高功率输出的同时,实现了较低的驱动电流,这对于提高系统效率和减少...
#include <queue> ... outfile.open("output.txt",ios::out); if(!outfile) { cerr; exit(1); } outfile ; for (int i = 1; i ; ++i) { outfile[i]; } outfile.close(); return 0; }
With 7-cm long fiber, a laser at near 2 μm is obtained with the threshold of 135 mW, maximum output power of 1.09 W, and slope efficiency of 9.6% with respect to the launched power from a laser ...
By Brian W. Kernighan and Dennis M. Ritchie. Published by Prentice-Hall in 1988 ISBN 0-13-110362-8 (paperback) ISBN 0-13-110370-9 目录结构: Contents Preface Preface to the first edition ...
We produce a maximum 1.45 W laser output at 1064 nm using a neodymium-doped silicate glass fiber that has a rectangular core with dimensions of ~6.3 μm×31.5 μm. The measured divergence angles of ...
Serial.print("Light Level: "); // 输出文本 Serial.println(sensorValue); // 输出模拟值 } ``` ### Arduino经典案例 - **Techart1[DVD]** - **Techart2[DVD]** - **Japan** - ...
The maximum average output power is 10.67 W with spectral bandwidth covering from ~1.9 to 4.1 μm. The single-mode ZBLAN fiber and silica fiber are thermal-spliced to enhance the robustness and ...
调通sina33下的AP6212A0(WIFI+BT) 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 ...完成时间:2017/6/26 11:01 版本:V1.1 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的官方SDK(Android...
The maximum power of 1.14 W is obtained with a pump power of 5.46 W at a wavelength of 976 nm. The slope efficiency is 34%. The refractive index fluctuation across the core is below 5×10-4 at a do...
调通sina33下的AP6212A0版本的BT 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 ...完成时间:2017/6/26 11:01 版本:V1.0 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的官方SDK(Android...
Up to 2 W (WSA8810) and 4 W (WSA8815) audio output power into 8 WSA8810 and WSA8815 support stereo application Temperature sensor for IC over-temp protection and speaker protection On-...
The central wavelength can be continuously tuned from 1113.76 to 1137.44 nm, and the output power exceeds 100 W for all of the lasing wavelengths with the polarization extinction ratio (PER) exce
个人资料网站 屏幕到gif <-只需捕获屏幕上的所有内容并... MP4到IOS可播放的MP4 ffmpeg -an -i INPUT.mp4 -vcodec libx264 -codec:a libmp3lame -qscale:a 1 -pix_fmt yuv420p -profile:v基线-level 3 OUTPUT.mp4
and 1-W output power. The gate driver is capable of delivering 4-A source and 6-A sink peak current. The driver implements reinforced isolation and can withstand 8-kV Peak and 5.7-kV RMS isolation ...
- `-vf`参数用于视频过滤,如裁剪`crop=w:h:x:y`, 水平翻转`hflip`, 垂直翻转`vflip`,调整大小`scale=w:h`等。 - `ffmpeg -i input.mp4 -vf "crop=1280:720:0:0" output.mp4`裁剪视频尺寸。 8. **多任务处理**:...
is capable to allow the system consuming only 0.5W power in standby mode. In normal operation, the AP384XG features adjustable frequency by using an external resistor and capacitor combination. When ...
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)-8s %(message)s', filename='autoupdate.log', filemode='w') logging.debug('A debug message') logging.info('Some ...
1. **功率/电平 (Power/Level)**:功率是指放大器输出信号能量的能力,通常以W、mW或dBm为单位。dBm是以1毫瓦为基准的对数单位,功率每增加一倍,电平值增加3dB。 2. **增益 (Gain)**:增益是放大器放大输入信号的...