aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/windows/svc/eventlog/log.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2019-01-10 10:57:50 +0100
committerOndrej Fabry <ofabry@cisco.com>2019-01-10 11:05:35 +0100
commit08266e35878f198e2fa59fcfc9f0fc3a4b1dfbf5 (patch)
tree1269acfc3bf6fdd47414eb64da3ecad4865e37d6 /vendor/golang.org/x/sys/windows/svc/eventlog/log.go
parent3ef6f210edcf7dd753733d46ec3f2dd5dc795b61 (diff)
Add support for string types
- strings are now generated as two fields for length and string itself - aliases are now sorted by name to prevent generating different code - dependencies are now managed by dep - binapi files are regenerated using VPP 19.01-rc0~622-g7b01e9e8 - old stats binary api has been deprecated and removed from VPP Change-Id: Ieb8515c73021339a45f407386f8e3d87dcf4469e Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'vendor/golang.org/x/sys/windows/svc/eventlog/log.go')
-rw-r--r--vendor/golang.org/x/sys/windows/svc/eventlog/log.go70
1 files changed, 0 insertions, 70 deletions
diff --git a/vendor/golang.org/x/sys/windows/svc/eventlog/log.go b/vendor/golang.org/x/sys/windows/svc/eventlog/log.go
deleted file mode 100644
index 46e5153..0000000
--- a/vendor/golang.org/x/sys/windows/svc/eventlog/log.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build windows
-
-// Package eventlog implements access to Windows event log.
-//
-package eventlog
-
-import (
- "errors"
- "syscall"
-
- "golang.org/x/sys/windows"
-)
-
-// Log provides access to the system log.
-type Log struct {
- Handle windows.Handle
-}
-
-// Open retrieves a handle to the specified event log.
-func Open(source string) (*Log, error) {
- return OpenRemote("", source)
-}
-
-// OpenRemote does the same as Open, but on different computer host.
-func OpenRemote(host, source string) (*Log, error) {
- if source == "" {
- return nil, errors.New("Specify event log source")
- }
- var s *uint16
- if host != "" {
- s = syscall.StringToUTF16Ptr(host)
- }
- h, err := windows.RegisterEventSource(s, syscall.StringToUTF16Ptr(source))
- if err != nil {
- return nil, err
- }
- return &Log{Handle: h}, nil
-}
-
-// Close closes event log l.
-func (l *Log) Close() error {
- return windows.DeregisterEventSource(l.Handle)
-}
-
-func (l *Log) report(etype uint16, eid uint32, msg string) error {
- ss := []*uint16{syscall.StringToUTF16Ptr(msg)}
- return windows.ReportEvent(l.Handle, etype, 0, eid, 0, 1, 0, &ss[0], nil)
-}
-
-// Info writes an information event msg with event id eid to the end of event log l.
-// When EventCreate.exe is used, eid must be between 1 and 1000.
-func (l *Log) Info(eid uint32, msg string) error {
- return l.report(windows.EVENTLOG_INFORMATION_TYPE, eid, msg)
-}
-
-// Warning writes an warning event msg with event id eid to the end of event log l.
-// When EventCreate.exe is used, eid must be between 1 and 1000.
-func (l *Log) Warning(eid uint32, msg string) error {
- return l.report(windows.EVENTLOG_WARNING_TYPE, eid, msg)
-}
-
-// Error writes an error event msg with event id eid to the end of event log l.
-// When EventCreate.exe is used, eid must be between 1 and 1000.
-func (l *Log) Error(eid uint32, msg string) error {
- return l.report(windows.EVENTLOG_ERROR_TYPE, eid, msg)
-}