You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

814 lines
24 KiB

8 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="theme-color" content="#375EAB">
  7. <title>log - The Go Programming Language</title>
  8. <link type="text/css" rel="stylesheet" href="../../lib/godoc/style.css">
  9. <link rel="stylesheet" href="../../lib/godoc/jquery.treeview.css">
  10. <script type="text/javascript">window.initFuncs = [];</script>
  11. </head>
  12. <body>
  13. <div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
  14. ...
  15. </div><!-- #lowframe -->
  16. <div id="topbar" class="wide"><div class="container">
  17. <div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
  18. <div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
  19. <a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
  20. <form method="GET" action="http://localhost:6060/search">
  21. <div id="menu">
  22. <a href="http://localhost:6060/doc/">Documents</a>
  23. <a href="http://localhost:6060/pkg/">Packages</a>
  24. <a href="http://localhost:6060/project/">The Project</a>
  25. <a href="http://localhost:6060/help/">Help</a>
  26. <a href="http://localhost:6060/blog/">Blog</a>
  27. <input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
  28. </div>
  29. </form>
  30. </div></div>
  31. <div id="page" class="wide">
  32. <div class="container">
  33. <h1>Package log</h1>
  34. <div id="nav"></div>
  35. <!--
  36. Copyright 2009 The Go Authors. All rights reserved.
  37. Use of this source code is governed by a BSD-style
  38. license that can be found in the LICENSE file.
  39. -->
  40. <!--
  41. Note: Static (i.e., not template-generated) href and id
  42. attributes start with "pkg-" to make it impossible for
  43. them to conflict with generated attributes (some of which
  44. correspond to Go identifiers).
  45. -->
  46. <script type='text/javascript'>
  47. document.ANALYSIS_DATA = null;
  48. document.CALLGRAPH = null;
  49. </script>
  50. <div id="short-nav">
  51. <dl>
  52. <dd><code>import "log"</code></dd>
  53. </dl>
  54. <dl>
  55. <dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
  56. <dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
  57. <dd><a href="index.html#pkg-examples" class="examplesLink">Examples</a></dd>
  58. <dd><a href="index.html#pkg-subdirectories">Subdirectories</a></dd>
  59. </dl>
  60. </div>
  61. <!-- The package's Name is printed as title by the top-level template -->
  62. <div id="pkg-overview" class="toggleVisible">
  63. <div class="collapsed">
  64. <h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
  65. </div>
  66. <div class="expanded">
  67. <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
  68. <p>
  69. Package log implements a simple logging package. It defines a type, Logger,
  70. with methods for formatting output. It also has a predefined &#39;standard&#39;
  71. Logger accessible through helper functions Print[f|ln], Fatal[f|ln], and
  72. Panic[f|ln], which are easier to use than creating a Logger manually.
  73. That logger writes to standard error and prints the date and time
  74. of each logged message.
  75. The Fatal functions call os.Exit(1) after writing the log message.
  76. The Panic functions call panic after writing the log message.
  77. </p>
  78. </div>
  79. </div>
  80. <div id="pkg-index" class="toggleVisible">
  81. <div class="collapsed">
  82. <h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
  83. </div>
  84. <div class="expanded">
  85. <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
  86. <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
  87. <div id="manual-nav">
  88. <dl>
  89. <dd><a href="index.html#pkg-constants">Constants</a></dd>
  90. <dd><a href="index.html#Fatal">func Fatal(v ...interface{})</a></dd>
  91. <dd><a href="index.html#Fatalf">func Fatalf(format string, v ...interface{})</a></dd>
  92. <dd><a href="index.html#Fatalln">func Fatalln(v ...interface{})</a></dd>
  93. <dd><a href="index.html#Flags">func Flags() int</a></dd>
  94. <dd><a href="index.html#Output">func Output(calldepth int, s string) error</a></dd>
  95. <dd><a href="index.html#Panic">func Panic(v ...interface{})</a></dd>
  96. <dd><a href="index.html#Panicf">func Panicf(format string, v ...interface{})</a></dd>
  97. <dd><a href="index.html#Panicln">func Panicln(v ...interface{})</a></dd>
  98. <dd><a href="index.html#Prefix">func Prefix() string</a></dd>
  99. <dd><a href="index.html#Print">func Print(v ...interface{})</a></dd>
  100. <dd><a href="index.html#Printf">func Printf(format string, v ...interface{})</a></dd>
  101. <dd><a href="index.html#Println">func Println(v ...interface{})</a></dd>
  102. <dd><a href="index.html#SetFlags">func SetFlags(flag int)</a></dd>
  103. <dd><a href="index.html#SetOutput">func SetOutput(w io.Writer)</a></dd>
  104. <dd><a href="index.html#SetPrefix">func SetPrefix(prefix string)</a></dd>
  105. <dd><a href="index.html#Logger">type Logger</a></dd>
  106. <dd>&nbsp; &nbsp; <a href="index.html#New">func New(out io.Writer, prefix string, flag int) *Logger</a></dd>
  107. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Fatal">func (l *Logger) Fatal(v ...interface{})</a></dd>
  108. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Fatalf">func (l *Logger) Fatalf(format string, v ...interface{})</a></dd>
  109. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Fatalln">func (l *Logger) Fatalln(v ...interface{})</a></dd>
  110. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Flags">func (l *Logger) Flags() int</a></dd>
  111. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Output">func (l *Logger) Output(calldepth int, s string) error</a></dd>
  112. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Panic">func (l *Logger) Panic(v ...interface{})</a></dd>
  113. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Panicf">func (l *Logger) Panicf(format string, v ...interface{})</a></dd>
  114. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Panicln">func (l *Logger) Panicln(v ...interface{})</a></dd>
  115. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Prefix">func (l *Logger) Prefix() string</a></dd>
  116. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Print">func (l *Logger) Print(v ...interface{})</a></dd>
  117. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Printf">func (l *Logger) Printf(format string, v ...interface{})</a></dd>
  118. <dd>&nbsp; &nbsp; <a href="index.html#Logger.Println">func (l *Logger) Println(v ...interface{})</a></dd>
  119. <dd>&nbsp; &nbsp; <a href="index.html#Logger.SetFlags">func (l *Logger) SetFlags(flag int)</a></dd>
  120. <dd>&nbsp; &nbsp; <a href="index.html#Logger.SetOutput">func (l *Logger) SetOutput(w io.Writer)</a></dd>
  121. <dd>&nbsp; &nbsp; <a href="index.html#Logger.SetPrefix">func (l *Logger) SetPrefix(prefix string)</a></dd>
  122. </dl>
  123. </div><!-- #manual-nav -->
  124. <div id="pkg-examples">
  125. <h4>Examples</h4>
  126. <dl>
  127. <dd><a class="exampleLink" href="index.html#example_Logger">Logger</a></dd>
  128. </dl>
  129. </div>
  130. <h4>Package files</h4>
  131. <p>
  132. <span style="font-size:90%">
  133. <a href="http://localhost:6060/src/log/log.go">log.go</a>
  134. </span>
  135. </p>
  136. </div><!-- .expanded -->
  137. </div><!-- #pkg-index -->
  138. <div id="pkg-callgraph" class="toggle" style="display: none">
  139. <div class="collapsed">
  140. <h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
  141. </div> <!-- .expanded -->
  142. <div class="expanded">
  143. <h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
  144. <p>
  145. In the call graph viewer below, each node
  146. is a function belonging to this package
  147. and its children are the functions it
  148. calls&mdash;perhaps dynamically.
  149. </p>
  150. <p>
  151. The root nodes are the entry points of the
  152. package: functions that may be called from
  153. outside the package.
  154. There may be non-exported or anonymous
  155. functions among them if they are called
  156. dynamically from another package.
  157. </p>
  158. <p>
  159. Click a node to visit that function's source code.
  160. From there you can visit its callers by
  161. clicking its declaring <code>func</code>
  162. token.
  163. </p>
  164. <p>
  165. Functions may be omitted if they were
  166. determined to be unreachable in the
  167. particular programs or tests that were
  168. analyzed.
  169. </p>
  170. <!-- Zero means show all package entry points. -->
  171. <ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
  172. </div>
  173. </div> <!-- #pkg-callgraph -->
  174. <h2 id="pkg-constants">Constants</h2>
  175. <pre>const (
  176. <span class="comment">// Bits or&#39;ed together to control what&#39;s printed.</span>
  177. <span class="comment">// There is no control over the order they appear (the order listed</span>
  178. <span class="comment">// here) or the format they present (as described in the comments).</span>
  179. <span class="comment">// The prefix is followed by a colon only when Llongfile or Lshortfile</span>
  180. <span class="comment">// is specified.</span>
  181. <span class="comment">// For example, flags Ldate | Ltime (or LstdFlags) produce,</span>
  182. <span class="comment">// 2009/01/23 01:23:23 message</span>
  183. <span class="comment">// while flags Ldate | Ltime | Lmicroseconds | Llongfile produce,</span>
  184. <span class="comment">// 2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message</span>
  185. <span id="Ldate">Ldate</span> = 1 &lt;&lt; <a href="../builtin/index.html#iota">iota</a> <span class="comment">// the date in the local time zone: 2009/01/23</span>
  186. <span id="Ltime">Ltime</span> <span class="comment">// the time in the local time zone: 01:23:23</span>
  187. <span id="Lmicroseconds">Lmicroseconds</span> <span class="comment">// microsecond resolution: 01:23:23.123123. assumes Ltime.</span>
  188. <span id="Llongfile">Llongfile</span> <span class="comment">// full file name and line number: /a/b/c/d.go:23</span>
  189. <span id="Lshortfile">Lshortfile</span> <span class="comment">// final file name element and line number: d.go:23. overrides Llongfile</span>
  190. <span id="LUTC">LUTC</span> <span class="comment">// if Ldate or Ltime is set, use UTC rather than the local time zone</span>
  191. <span id="LstdFlags">LstdFlags</span> = <a href="index.html#Ldate">Ldate</a> | <a href="index.html#Ltime">Ltime</a> <span class="comment">// initial values for the standard logger</span>
  192. )</pre>
  193. <p>
  194. These flags define which text to prefix to each log entry generated by the Logger.
  195. </p>
  196. <h2 id="Fatal">func <a href="http://localhost:6060/src/log/log.go?s=8938:8966#L289">Fatal</a></h2>
  197. <pre>func Fatal(v ...interface{})</pre>
  198. <p>
  199. Fatal is equivalent to Print() followed by a call to os.Exit(1).
  200. </p>
  201. <h2 id="Fatalf">func <a href="http://localhost:6060/src/log/log.go?s=9087:9131#L295">Fatalf</a></h2>
  202. <pre>func Fatalf(format <a href="../builtin/index.html#string">string</a>, v ...interface{})</pre>
  203. <p>
  204. Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
  205. </p>
  206. <h2 id="Fatalln">func <a href="http://localhost:6060/src/log/log.go?s=9263:9293#L301">Fatalln</a></h2>
  207. <pre>func Fatalln(v ...interface{})</pre>
  208. <p>
  209. Fatalln is equivalent to Println() followed by a call to os.Exit(1).
  210. </p>
  211. <h2 id="Flags">func <a href="http://localhost:6060/src/log/log.go?s=7883:7899#L249">Flags</a></h2>
  212. <pre>func Flags() <a href="../builtin/index.html#int">int</a></pre>
  213. <p>
  214. Flags returns the output flags for the standard logger.
  215. </p>
  216. <h2 id="Output">func <a href="http://localhost:6060/src/log/log.go?s=10268:10310#L334">Output</a></h2>
  217. <pre>func Output(calldepth <a href="../builtin/index.html#int">int</a>, s <a href="../builtin/index.html#string">string</a>) <a href="../builtin/index.html#error">error</a></pre>
  218. <p>
  219. Output writes the output for a logging event. The string s contains
  220. the text to print after the prefix specified by the flags of the
  221. Logger. A newline is appended if the last character of s is not
  222. already a newline. Calldepth is the count of the number of
  223. frames to skip when computing the file name and line number
  224. if Llongfile or Lshortfile is set; a value of 1 will print the details
  225. for the caller of Output.
  226. </p>
  227. <h2 id="Panic">func <a href="http://localhost:6060/src/log/log.go?s=9411:9439#L307">Panic</a></h2>
  228. <pre>func Panic(v ...interface{})</pre>
  229. <p>
  230. Panic is equivalent to Print() followed by a call to panic().
  231. </p>
  232. <h2 id="Panicf">func <a href="http://localhost:6060/src/log/log.go?s=9563:9607#L314">Panicf</a></h2>
  233. <pre>func Panicf(format <a href="../builtin/index.html#string">string</a>, v ...interface{})</pre>
  234. <p>
  235. Panicf is equivalent to Printf() followed by a call to panic().
  236. </p>
  237. <h2 id="Panicln">func <a href="http://localhost:6060/src/log/log.go?s=9742:9772#L321">Panicln</a></h2>
  238. <pre>func Panicln(v ...interface{})</pre>
  239. <p>
  240. Panicln is equivalent to Println() followed by a call to panic().
  241. </p>
  242. <h2 id="Prefix">func <a href="http://localhost:6060/src/log/log.go?s=8094:8114#L259">Prefix</a></h2>
  243. <pre>func Prefix() <a href="../builtin/index.html#string">string</a></pre>
  244. <p>
  245. Prefix returns the output prefix for the standard logger.
  246. </p>
  247. <h2 id="Print">func <a href="http://localhost:6060/src/log/log.go?s=8418:8446#L272">Print</a></h2>
  248. <pre>func Print(v ...interface{})</pre>
  249. <p>
  250. Print calls Output to print to the standard logger.
  251. Arguments are handled in the manner of fmt.Print.
  252. </p>
  253. <h2 id="Printf">func <a href="http://localhost:6060/src/log/log.go?s=8595:8639#L278">Printf</a></h2>
  254. <pre>func Printf(format <a href="../builtin/index.html#string">string</a>, v ...interface{})</pre>
  255. <p>
  256. Printf calls Output to print to the standard logger.
  257. Arguments are handled in the manner of fmt.Printf.
  258. </p>
  259. <h2 id="Println">func <a href="http://localhost:6060/src/log/log.go?s=8799:8829#L284">Println</a></h2>
  260. <pre>func Println(v ...interface{})</pre>
  261. <p>
  262. Println calls Output to print to the standard logger.
  263. Arguments are handled in the manner of fmt.Println.
  264. </p>
  265. <h2 id="SetFlags">func <a href="http://localhost:6060/src/log/log.go?s=7984:8007#L254">SetFlags</a></h2>
  266. <pre>func SetFlags(flag <a href="../builtin/index.html#int">int</a>)</pre>
  267. <p>
  268. SetFlags sets the output flags for the standard logger.
  269. </p>
  270. <h2 id="SetOutput">func <a href="http://localhost:6060/src/log/log.go?s=7740:7767#L242">SetOutput</a></h2>
  271. <pre>func SetOutput(w <a href="../io/index.html">io</a>.<a href="../io/index.html#Writer">Writer</a>)</pre>
  272. <p>
  273. SetOutput sets the output destination for the standard logger.
  274. </p>
  275. <h2 id="SetPrefix">func <a href="http://localhost:6060/src/log/log.go?s=8202:8231#L264">SetPrefix</a></h2>
  276. <pre>func SetPrefix(prefix <a href="../builtin/index.html#string">string</a>)</pre>
  277. <p>
  278. SetPrefix sets the output prefix for the standard logger.
  279. </p>
  280. <h2 id="Logger">type <a href="http://localhost:6060/src/log/log.go?s=2250:2542#L38">Logger</a></h2>
  281. <pre>type Logger struct {
  282. <span class="comment">// contains filtered or unexported fields</span>
  283. }</pre>
  284. <p>
  285. A Logger represents an active logging object that generates lines of
  286. output to an io.Writer. Each logging operation makes a single call to
  287. the Writer&#39;s Write method. A Logger can be used simultaneously from
  288. multiple goroutines; it guarantees to serialize access to the Writer.
  289. </p>
  290. <div id="example_Logger" class="toggle">
  291. <div class="collapsed">
  292. <p class="exampleHeading toggleButton"><span class="text">Example</span></p>
  293. </div>
  294. <div class="expanded">
  295. <p class="exampleHeading toggleButton"><span class="text">Example</span></p>
  296. <p>Code:</p>
  297. <pre class="code">var buf bytes.Buffer
  298. logger := log.New(&amp;buf, &#34;logger: &#34;, log.Lshortfile)
  299. logger.Print(&#34;Hello, log file!&#34;)
  300. fmt.Print(&amp;buf)
  301. <span class="comment"></pre>
  302. <p>Output:</p>
  303. <pre class="output">logger: example_test.go:16: Hello, log file!
  304. </pre>
  305. </div>
  306. </div>
  307. <h3 id="New">func <a href="http://localhost:6060/src/log/log.go?s=2771:2827#L50">New</a></h3>
  308. <pre>func New(out <a href="../io/index.html">io</a>.<a href="../io/index.html#Writer">Writer</a>, prefix <a href="../builtin/index.html#string">string</a>, flag <a href="../builtin/index.html#int">int</a>) *<a href="index.html#Logger">Logger</a></pre>
  309. <p>
  310. New creates a new Logger. The out variable sets the
  311. destination to which log data will be written.
  312. The prefix appears at the beginning of each generated log line.
  313. The flag argument defines the logging properties.
  314. </p>
  315. <h3 id="Logger.Fatal">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=6145:6185#L175">Fatal</a></h3>
  316. <pre>func (l *<a href="index.html#Logger">Logger</a>) Fatal(v ...interface{})</pre>
  317. <p>
  318. Fatal is equivalent to l.Print() followed by a call to os.Exit(1).
  319. </p>
  320. <h3 id="Logger.Fatalf">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=6306:6362#L181">Fatalf</a></h3>
  321. <pre>func (l *<a href="index.html#Logger">Logger</a>) Fatalf(format <a href="../builtin/index.html#string">string</a>, v ...interface{})</pre>
  322. <p>
  323. Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).
  324. </p>
  325. <h3 id="Logger.Fatalln">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=6494:6536#L187">Fatalln</a></h3>
  326. <pre>func (l *<a href="index.html#Logger">Logger</a>) Fatalln(v ...interface{})</pre>
  327. <p>
  328. Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).
  329. </p>
  330. <h3 id="Logger.Flags">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=7158:7186#L214">Flags</a></h3>
  331. <pre>func (l *<a href="index.html#Logger">Logger</a>) Flags() <a href="../builtin/index.html#int">int</a></pre>
  332. <p>
  333. Flags returns the output flags for the logger.
  334. </p>
  335. <h3 id="Logger.Output">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=4899:4953#L133">Output</a></h3>
  336. <pre>func (l *<a href="index.html#Logger">Logger</a>) Output(calldepth <a href="../builtin/index.html#int">int</a>, s <a href="../builtin/index.html#string">string</a>) <a href="../builtin/index.html#error">error</a></pre>
  337. <p>
  338. Output writes the output for a logging event. The string s contains
  339. the text to print after the prefix specified by the flags of the
  340. Logger. A newline is appended if the last character of s is not
  341. already a newline. Calldepth is used to recover the PC and is
  342. provided for generality, although at the moment on all pre-defined
  343. paths it will be 2.
  344. </p>
  345. <h3 id="Logger.Panic">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=6654:6694#L193">Panic</a></h3>
  346. <pre>func (l *<a href="index.html#Logger">Logger</a>) Panic(v ...interface{})</pre>
  347. <p>
  348. Panic is equivalent to l.Print() followed by a call to panic().
  349. </p>
  350. <h3 id="Logger.Panicf">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=6818:6874#L200">Panicf</a></h3>
  351. <pre>func (l *<a href="index.html#Logger">Logger</a>) Panicf(format <a href="../builtin/index.html#string">string</a>, v ...interface{})</pre>
  352. <p>
  353. Panicf is equivalent to l.Printf() followed by a call to panic().
  354. </p>
  355. <h3 id="Logger.Panicln">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=7009:7051#L207">Panicln</a></h3>
  356. <pre>func (l *<a href="index.html#Logger">Logger</a>) Panicln(v ...interface{})</pre>
  357. <p>
  358. Panicln is equivalent to l.Println() followed by a call to panic().
  359. </p>
  360. <h3 id="Logger.Prefix">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=7433:7465#L228">Prefix</a></h3>
  361. <pre>func (l *<a href="index.html#Logger">Logger</a>) Prefix() <a href="../builtin/index.html#string">string</a></pre>
  362. <p>
  363. Prefix returns the output prefix for the logger.
  364. </p>
  365. <h3 id="Logger.Print">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=5814:5854#L168">Print</a></h3>
  366. <pre>func (l *<a href="index.html#Logger">Logger</a>) Print(v ...interface{})</pre>
  367. <p>
  368. Print calls l.Output to print to the logger.
  369. Arguments are handled in the manner of fmt.Print.
  370. </p>
  371. <h3 id="Logger.Printf">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=5611:5667#L162">Printf</a></h3>
  372. <pre>func (l *<a href="index.html#Logger">Logger</a>) Printf(format <a href="../builtin/index.html#string">string</a>, v ...interface{})</pre>
  373. <p>
  374. Printf calls l.Output to print to the logger.
  375. Arguments are handled in the manner of fmt.Printf.
  376. </p>
  377. <h3 id="Logger.Println">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=5995:6037#L172">Println</a></h3>
  378. <pre>func (l *<a href="index.html#Logger">Logger</a>) Println(v ...interface{})</pre>
  379. <p>
  380. Println calls l.Output to print to the logger.
  381. Arguments are handled in the manner of fmt.Println.
  382. </p>
  383. <h3 id="Logger.SetFlags">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=7291:7326#L221">SetFlags</a></h3>
  384. <pre>func (l *<a href="index.html#Logger">Logger</a>) SetFlags(flag <a href="../builtin/index.html#int">int</a>)</pre>
  385. <p>
  386. SetFlags sets the output flags for the logger.
  387. </p>
  388. <h3 id="Logger.SetOutput">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=2944:2983#L55">SetOutput</a></h3>
  389. <pre>func (l *<a href="index.html#Logger">Logger</a>) SetOutput(w <a href="../io/index.html">io</a>.<a href="../io/index.html#Writer">Writer</a>)</pre>
  390. <p>
  391. SetOutput sets the output destination for the logger.
  392. </p>
  393. <h3 id="Logger.SetPrefix">func (*Logger) <a href="http://localhost:6060/src/log/log.go?s=7574:7615#L235">SetPrefix</a></h3>
  394. <pre>func (l *<a href="index.html#Logger">Logger</a>) SetPrefix(prefix <a href="../builtin/index.html#string">string</a>)</pre>
  395. <p>
  396. SetPrefix sets the output prefix for the logger.
  397. </p>
  398. <h2 id="pkg-subdirectories">Subdirectories</h2>
  399. <div class="pkg-dir">
  400. <table>
  401. <tr>
  402. <th class="pkg-name">Name</th>
  403. <th class="pkg-synopsis">Synopsis</th>
  404. </tr>
  405. <tr>
  406. <td colspan="2"><a href="http://localhost:6060/pkg/">..</a></td>
  407. </tr>
  408. <tr>
  409. <td class="pkg-name" style="padding-left: 0px;">
  410. <a href="syslog/index.html">syslog</a>
  411. </td>
  412. <td class="pkg-synopsis">
  413. Package syslog provides a simple interface to the system log service.
  414. </td>
  415. </tr>
  416. </table>
  417. </div>
  418. <div id="footer">
  419. Build version go1.6.<br>
  420. Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
  421. the content of this page is licensed under the
  422. Creative Commons Attribution 3.0 License,
  423. and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
  424. <a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
  425. <a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
  426. </div>
  427. </div><!-- .container -->
  428. </div><!-- #page -->
  429. <!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
  430. <script type="text/javascript" src="../../lib/godoc/jquery.js"></script>
  431. <script type="text/javascript" src="../../lib/godoc/jquery.treeview.js"></script>
  432. <script type="text/javascript" src="../../lib/godoc/jquery.treeview.edit.js"></script>
  433. <script type="text/javascript" src="../../lib/godoc/godocs.js"></script>
  434. </body>
  435. </html>