Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
Is the log package thread-safe?
2,418 views
Skip to first unread message
Kowshik Prakasam
unread,
Sep 13, 2012, 4:59:19 PM
9/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
Is the log package (
http://golang.org/pkg/log
) thread-safe?
-Kowshik
Jesse McNelis
unread,
Sep 13, 2012, 7:54:55 PM
9/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Kowshik Prakasam, golan...@googlegroups.com
On Fri, Sep 14, 2012 at 6:59 AM, Kowshik Prakasam <
kow...@gmail.com
> wrote:
> Is the log package (
http://golang.org/pkg/log
) thread-safe?
It's not documented as such. But the code shows that the Logger is thread-safe
as long as the underlying io.Writer is thread-safe or it has exclusive
access to it.
--
=====================
http://jessta.id.au
Rob Pike
unread,
Sep 17, 2012, 1:19:38 PM
9/17/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jesse McNelis, Kowshik Prakasam, golan...@googlegroups.com
It is documented. Logger says:
A Logger can be used simultaneously from
// multiple goroutines; it guarantees to serialize access to the Writer.
-rob
Reply all
Reply to author
Forward
0 new messages