Skip to content

Commit 542cb14

Browse files
authored
Support new logger configuration functions (#99)
* Support new logger configuration functions * Separate functions for logging setup
1 parent af9b99b commit 542cb14

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

cse/cse.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,3 +815,13 @@ type Simulation struct {
815815
func CreateEmptySimulation() Simulation {
816816
return Simulation{}
817817
}
818+
819+
func SetupLogging() {
820+
success := C.cse_log_setup_simple_console_logging()
821+
if int(success) < 0 {
822+
log.Println("Could not set up console logging!")
823+
} else {
824+
C.cse_log_set_output_level(C.CSE_LOG_SEVERITY_INFO)
825+
log.Println("Console logging set up with severity: INFO")
826+
}
827+
}

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
)
88

99
func main() {
10+
cse.SetupLogging()
1011
sim := cse.CreateEmptySimulation()
1112

1213
// Creating a command channel

0 commit comments

Comments
 (0)