- iostream[meta header]
- std[meta namespace]
- variable[meta id-type]
namespace std {
extern wostream wclog;
}- wostream[link ../ostream/basic_ostream.md]
wclogは、標準エラー出力に対するワイド文字用の出力ストリームオブジェクトである。
すなわち、std::basic_streambufから派生していて<cstdio>のstderrオブジェクトに結びつけられているストリームバッファに出力する。
wcerrと異なり、unitbufフラグは指定されていない。そのため、出力操作のたびにバッファの吐き出しは行われず、ログ出力のように出力量が多い用途に適している。
wclogはwide character logを意味する。[1]
#include <iostream>
int main()
{
std::wclog << L"start" << std::endl;
// ...
std::wclog << L"end" << std::endl;
}- std::wclog[color ff0000]
start
end
- C++98
- ワイド文字の出力が期待どおりに表示されない場合がある。ロケールや端末の設定については
wcoutの備考を参照
- ^ Stroustrup: C++ Style and Technique FAQ(2018-08-21 17:01 JST 閲覧)