Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.57 KB

wclog.md

File metadata and controls

58 lines (42 loc) · 1.57 KB

wclog

  • 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の備考を参照

出典

  1. ^ Stroustrup: C++ Style and Technique FAQ(2018-08-21 17:01 JST 閲覧)

関連項目