1 // Copyright 2015 CoreOS, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Package journal provides write bindings to the local systemd journal. 16 // It is implemented in pure Go and connects to the journal directly over its 17 // unix socket. 18 // 19 // To read from the journal, see the "sdjournal" package, which wraps the 20 // sd-journal a C API. 21 // 22 // http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html 23 package journal 24 25 import ( 26 "fmt" 27 ) 28 29 // Priority of a journal message 30 type Priority int 31 32 const ( 33 PriEmerg Priority = iota 34 PriAlert 35 PriCrit 36 PriErr 37 PriWarning 38 PriNotice 39 PriInfo 40 PriDebug 41 ) 42 43 // Print prints a message to the local systemd journal using Send(). 44 func Print(priority Priority, format string, a ...interface{}) error { 45 return Send(fmt.Sprintf(format, a...), priority, nil) 46 } 47